diff options
-rw-r--r-- | src/dotnet/install.sh | 27 | ||||
-rwxr-xr-x | test/dotnet/test.sh | 8 |
2 files changed, 14 insertions, 21 deletions
diff --git a/src/dotnet/install.sh b/src/dotnet/install.sh index e629576..bd44be2 100644 --- a/src/dotnet/install.sh +++ b/src/dotnet/install.sh @@ -7,16 +7,14 @@ # Docs: https://github.com/devcontainers/features/tree/main/src/dotnet # Maintainer: The VS Code and Codespaces Teams -VERSION="${VERSION:-"latest"}" -ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}" -RUNTIME_ONLY="${RUNTIMEONLY:-"false"}" - -INSTALL_DIR="/usr/local/dotnet/current" +DOTNET_VERSION="${VERSION:-'latest'}" +DOTNET_ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-''}" +DOTNET_RUNTIME_ONLY="${RUNTIMEONLY:-'false'}" +DOTNET_INSTALL_DIR='/usr/local/dotnet/current' set -e -apt_get_update() -{ +apt_get_update() { if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then echo "Running apt-get update..." apt-get update -y @@ -36,20 +34,19 @@ if [ "$(id -u)" -ne 0 ]; then exit 1 fi -# Install dependencies +# icu-devtools includes dependencies for .NET check_packages wget ca-certificates icu-devtools -# apt-transport-https curl gnupg2 dirmngr - -# Download installer installer_script="/tmp/dotnet-install.sh" - wget -O "$installer_script" https://dot.net/v1/dotnet-install.sh + chmod +x "$installer_script" -# Install primary version -"$installer_script" --install-dir "$INSTALL_DIR" +# TODO: Install the version specified by DOTNET_VERSION option +"$installer_script" --install-dir "$DOTNET_INSTALL_DIR" + +# TODO: Install additional versions -# ./dotnet-install.sh -v "$DOTNET_3_LIVESHARE_VERSION" --install-dir /home/codespace/.dotnet +rm "$installer_script" echo "Done!" diff --git a/test/dotnet/test.sh b/test/dotnet/test.sh index 74c71bd..5bbcd74 100755 --- a/test/dotnet/test.sh +++ b/test/dotnet/test.sh @@ -2,10 +2,10 @@ set -e -# Optional: Import test library +# Import test library source dev-container-features-test-lib -# Definition specific tests +# Make sure .NET is installed check "info" dotnet --info check "list-sdks" dotnet --list-sdks check "version" dotnet --version @@ -14,9 +14,5 @@ check "version" dotnet --version check "current link info" /usr/local/dotnet/current/dotnet --info check "current link sdk directory" ls -l /usr/local/dotnet/current/sdk -# TODO: Installer script defaults to .NET 6 as that's LTS. Update this test or remove it. -# echo "Validating expected version present..." -# check "some major version of dotnet 7 is installed" bash -c "dotnet --version | grep '7\.[0-9]*\.[0-9]*'" - # Report result reportResults |