diff --git a/externals/install-dotnet.sh b/externals/install-dotnet.sh index 13d30ad..8ffe169 100755 --- a/externals/install-dotnet.sh +++ b/externals/install-dotnet.sh @@ -489,7 +489,7 @@ get_specific_version_from_version() { local json_file="$5" if [ -z "$json_file" ]; then - if [[ "$version" == "latest" ]]; then + if [[ "$version" == "latest" ]]; then local version_info version_info="$(get_latest_version_info "$azure_feed" "$channel" "$normalized_architecture" false)" || return 1 say_verbose "get_specific_version_from_version: version_info=$version_info" @@ -522,7 +522,7 @@ construct_download_link() { local specific_version="${4//[$'\t\r\n']}" local specific_product_version="$(get_specific_product_version "$1" "$4")" local osname="$5" - + local download_link=null if [[ "$runtime" == "dotnet" ]]; then download_link="$azure_feed/Runtime/$specific_version/dotnet-runtime-$specific_product_version-$osname-$normalized_architecture.tar.gz" @@ -542,7 +542,7 @@ construct_download_link() { # azure_feed - $1 # specific_version - $2 get_specific_product_version() { - # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents + # If we find a 'productVersion.txt' at the root of any folder, we'll use its contents # to resolve the version of what's in the folder, superseding the specified version. eval $invocation @@ -753,9 +753,8 @@ download() { elif machine_has "wget"; then downloadwget "$remote_path" "$out_path" || failed=true else - unset http_code - download_error_msg="Missing dependency: neither curl nor wget was found." - break + say_err "Missing dependency: neither curl nor wget was found." + exit 1 fi if [ "$failed" = false ] || [ $attempts -ge 3 ] || { [ ! -z $http_code ] && [ $http_code = "404" ]; }; then @@ -905,10 +904,10 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" # if the download fails, download the legacy_download_link if [ "$download_failed" = true ]; then + primary_path_http_code="$http_code"; primary_path_download_error_msg="$download_error_msg" case $primary_path_http_code in 404) say "The resource at $download_link is not available." @@ -928,9 +927,9 @@ install_dotnet() { # The download function will set variables $http_code and $download_error_msg in case of failure. download "$download_link" "$zip_path" 2>&1 || download_failed=true - legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" if [ "$download_failed" = true ]; then + legacy_path_http_code="$http_code"; legacy_path_download_error_msg="$download_error_msg" case $legacy_path_http_code in 404) say "The resource at $download_link is not available." @@ -1132,10 +1131,10 @@ do echo " --arch,-Architecture,-Arch" echo " Possible values: x64, arm, and arm64" echo " --os Specifies operating system to be used when selecting the installer." - echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." - echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." + echo " Overrides the OS determination approach used by the script. Supported values: osx, linux, linux-musl, freebsd, rhel.6." + echo " In case any other value is provided, the platform will be determined by the script based on machine configuration." echo " Not supported for legacy links. Use --runtime-id to specify platform for legacy links." - echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." + echo " Refer to: https://aka.ms/dotnet-os-lifecycle for more information." echo " --runtime Installs a shared runtime only, without the SDK." echo " -Runtime" echo " Possible values:" @@ -1160,7 +1159,7 @@ do echo " Installs just the shared runtime bits, not the entire SDK." echo " --runtime-id Installs the .NET Tools for the given platform (use linux-x64 for portable linux)." echo " -RuntimeId" The parameter is obsolete and may be removed in a future version of this script. Should be used only for versions below 2.1. - echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." + echo " For primary links to override OS or/and architecture, use --os and --architecture option instead." echo "" echo "Install Location:" echo " Location is chosen in following order:" @@ -1197,7 +1196,7 @@ if [ "$dry_run" = true ]; then if [ "$valid_legacy_download_link" = true ]; then say "Legacy named payload URL: $legacy_download_link" fi - repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" + repeatable_command="./$script_name --version "\""$specific_version"\"" --install-dir "\""$install_root"\"" --architecture "\""$normalized_architecture"\"" --os "\""$normalized_os"\""" if [[ "$runtime" == "dotnet" ]]; then repeatable_command+=" --runtime "\""dotnet"\""" elif [[ "$runtime" == "aspnetcore" ]]; then