mirror of
https://github.com/actions/setup-dotnet.git
synced 2025-08-20 15:40:20 +00:00
Update installer scripts
This commit is contained in:
parent
9858bda9ee
commit
31ddd25ffd
49
externals/install-dotnet.sh
vendored
49
externals/install-dotnet.sh
vendored
@ -637,11 +637,13 @@ get_specific_product_version() {
|
|||||||
|
|
||||||
if machine_has "curl"
|
if machine_has "curl"
|
||||||
then
|
then
|
||||||
specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1)
|
if ! specific_product_version=$(curl -s --fail "${download_link}${feed_credential}" 2>&1); then
|
||||||
if [ $? = 0 ]; then
|
continue
|
||||||
|
else
|
||||||
echo "${specific_product_version//[$'\t\r\n']}"
|
echo "${specific_product_version//[$'\t\r\n']}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
elif machine_has "wget"
|
elif machine_has "wget"
|
||||||
then
|
then
|
||||||
specific_product_version=$(wget -qO- "${download_link}${feed_credential}" 2>&1)
|
specific_product_version=$(wget -qO- "${download_link}${feed_credential}" 2>&1)
|
||||||
@ -921,9 +923,15 @@ get_http_header_wget() {
|
|||||||
local remote_path="$1"
|
local remote_path="$1"
|
||||||
local disable_feed_credential="$2"
|
local disable_feed_credential="$2"
|
||||||
local wget_options="-q -S --spider --tries 5 "
|
local wget_options="-q -S --spider --tries 5 "
|
||||||
# Store options that aren't supported on all wget implementations separately.
|
|
||||||
local wget_options_extra="--waitretry 2 --connect-timeout 15 "
|
local wget_options_extra=''
|
||||||
local wget_result=''
|
|
||||||
|
# Test for options that aren't supported on all wget implementations.
|
||||||
|
if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then
|
||||||
|
wget_options_extra="--waitretry 2 --connect-timeout 15 "
|
||||||
|
else
|
||||||
|
say "wget extra options are unavailable for this environment"
|
||||||
|
fi
|
||||||
|
|
||||||
remote_path_with_credential="$remote_path"
|
remote_path_with_credential="$remote_path"
|
||||||
if [ "$disable_feed_credential" = false ]; then
|
if [ "$disable_feed_credential" = false ]; then
|
||||||
@ -931,15 +939,8 @@ get_http_header_wget() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
wget $wget_options $wget_options_extra "$remote_path_with_credential" 2>&1
|
wget $wget_options $wget_options_extra "$remote_path_with_credential" 2>&1
|
||||||
wget_result=$?
|
|
||||||
|
|
||||||
if [[ $wget_result == 2 ]]; then
|
return $?
|
||||||
# Parsing of the command has failed. Exclude potentially unrecognized options and retry.
|
|
||||||
wget $wget_options "$remote_path_with_credential" 2>&1
|
|
||||||
return $?
|
|
||||||
fi
|
|
||||||
|
|
||||||
return $wget_result
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# args:
|
# args:
|
||||||
@ -1030,10 +1031,17 @@ downloadwget() {
|
|||||||
# Append feed_credential as late as possible before calling wget to avoid logging feed_credential
|
# Append feed_credential as late as possible before calling wget to avoid logging feed_credential
|
||||||
local remote_path_with_credential="${remote_path}${feed_credential}"
|
local remote_path_with_credential="${remote_path}${feed_credential}"
|
||||||
local wget_options="--tries 20 "
|
local wget_options="--tries 20 "
|
||||||
# Store options that aren't supported on all wget implementations separately.
|
|
||||||
local wget_options_extra="--waitretry 2 --connect-timeout 15 "
|
local wget_options_extra=''
|
||||||
local wget_result=''
|
local wget_result=''
|
||||||
|
|
||||||
|
# Test for options that aren't supported on all wget implementations.
|
||||||
|
if [[ $(wget -h 2>&1 | grep -E 'waitretry|connect-timeout') ]]; then
|
||||||
|
wget_options_extra="--waitretry 2 --connect-timeout 15 "
|
||||||
|
else
|
||||||
|
say "wget extra options are unavailable for this environment"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$out_path" ]; then
|
if [ -z "$out_path" ]; then
|
||||||
wget -q $wget_options $wget_options_extra -O - "$remote_path_with_credential" 2>&1
|
wget -q $wget_options $wget_options_extra -O - "$remote_path_with_credential" 2>&1
|
||||||
wget_result=$?
|
wget_result=$?
|
||||||
@ -1042,17 +1050,6 @@ downloadwget() {
|
|||||||
wget_result=$?
|
wget_result=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $wget_result == 2 ]]; then
|
|
||||||
# Parsing of the command has failed. Exclude potentially unrecognized options and retry.
|
|
||||||
if [ -z "$out_path" ]; then
|
|
||||||
wget -q $wget_options -O - "$remote_path_with_credential" 2>&1
|
|
||||||
wget_result=$?
|
|
||||||
else
|
|
||||||
wget $wget_options -O "$out_path" "$remote_path_with_credential" 2>&1
|
|
||||||
wget_result=$?
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $wget_result != 0 ]]; then
|
if [[ $wget_result != 0 ]]; then
|
||||||
local disable_feed_credential=false
|
local disable_feed_credential=false
|
||||||
local response=$(get_http_header_wget $remote_path $disable_feed_credential)
|
local response=$(get_http_header_wget $remote_path $disable_feed_credential)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user