Skip to content

Instantly share code, notes, and snippets.

@DanielSSilva
Created September 27, 2020 23:31
Show Gist options
  • Save DanielSSilva/d7aa088605ac6c0a639da577f6b02c20 to your computer and use it in GitHub Desktop.
Save DanielSSilva/d7aa088605ac6c0a639da577f6b02c20 to your computer and use it in GitHub Desktop.
This is an adaptation from MS helper to install dependencies, but to install dotnet 3.1 only
#!/bin/bash
set -e
# Select a default .NET version if one is not specified
if [ -z "$DOTNET_VERSION" ]; then
DOTNET_VERSION=3.1.300
fi
# Install .NET as the sudo (non-root) user
sudo -i -u $SUDO_USER bash << EOF
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin -c Current -v $DOTNET_VERSION
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment