Fix quoting bug

This commit is contained in:
JP Ungaretti 2023-03-01 07:07:28 +00:00
parent 6b84b694ad
commit d432ed1d6d

View file

@ -7,9 +7,9 @@
# Docs: https://github.com/devcontainers/features/tree/main/src/dotnet # Docs: https://github.com/devcontainers/features/tree/main/src/dotnet
# Maintainer: The VS Code and Codespaces Teams # Maintainer: The VS Code and Codespaces Teams
DOTNET_VERSION="${VERSION:-'latest'}" DOTNET_VERSION="${VERSION:-"latest"}"
DOTNET_ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-''}" DOTNET_ADDITIONAL_VERSIONS="${ADDITIONALVERSIONS:-""}"
DOTNET_RUNTIME_ONLY="${RUNTIMEONLY:-'false'}" DOTNET_RUNTIME_ONLY="${RUNTIMEONLY:-"false"}"
DOTNET_INSTALL_SCRIPT_URL='https://dot.net/v1/dotnet-install.sh' DOTNET_INSTALL_SCRIPT_URL='https://dot.net/v1/dotnet-install.sh'
DOTNET_INSTALL_SCRIPT='/tmp/dotnet-install.sh' DOTNET_INSTALL_SCRIPT='/tmp/dotnet-install.sh'
@ -44,11 +44,11 @@ install_version() {
# If version is just a major value (form 'N'), assume it is a channel # If version is just a major value (form 'N'), assume it is a channel
if [[ "$version" =~ ^[0-9]+$ ]]; then if [[ "$version" =~ ^[0-9]+$ ]]; then
channel="$version.0" channel="$version.0"
version='latest' version="latest"
fi fi
# Make sure the version is formatted correctly (form 'N' is handled before this) # Make sure the version is formatted correctly (form 'N' is handled before this)
if ! [[ "$version" = 'latest' || "$version" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then if ! [[ "$version" = "latest" || "$version" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]]; then
echo "Invalid version '$version': version must be 'latest' or use the form 'N.M.O'" echo "Invalid version '$version': version must be 'latest' or use the form 'N.M.O'"
return 1 return 1
fi fi