Handle OS detection errors
Check the exit status of get_latest_version_info and get_current_os_name to prevent construction of invalid download URLs based on these functions. Fixes #2923.
This commit is contained in:
parent
3a567e5957
commit
b8a5219773
1 changed files with 8 additions and 5 deletions
9
scripts/obtain/dotnet-install.sh
vendored
9
scripts/obtain/dotnet-install.sh
vendored
|
@ -282,7 +282,8 @@ get_latest_version_info() {
|
|||
local azure_channel=$2
|
||||
local normalized_architecture=$3
|
||||
|
||||
local osname=$(get_current_os_name)
|
||||
local osname
|
||||
osname=$(get_current_os_name) || return 1
|
||||
|
||||
local version_file_url=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
|
@ -331,7 +332,8 @@ get_specific_version_from_version() {
|
|||
|
||||
case $version in
|
||||
latest)
|
||||
local version_info="$(get_latest_version_info $azure_feed $azure_channel $normalized_architecture)"
|
||||
local version_info
|
||||
version_info="$(get_latest_version_info $azure_feed $azure_channel $normalized_architecture)" || return 1
|
||||
say_verbose "get_specific_version_from_version: version_info=$version_info"
|
||||
echo "$version_info" | get_version_from_version_info
|
||||
return 0
|
||||
|
@ -360,7 +362,8 @@ construct_download_link() {
|
|||
local normalized_architecture=$3
|
||||
local specific_version=${4//[$'\t\r\n']}
|
||||
|
||||
local osname=$(get_current_os_name)
|
||||
local osname
|
||||
osname=$(get_current_os_name) || return 1
|
||||
|
||||
local download_link=null
|
||||
if [ "$shared_runtime" = true ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue