Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Handle missing VERSION_ID gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
juergenhoetzel committed Jun 7, 2017
1 parent defa3c3 commit a0cdc60
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/obtain/dotnet-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ get_distro_specific_os_name() {
eval $invocation

local uname=$(uname)
local osName="undefined"
if [ "$uname" = "Darwin" ]; then
echo "osx"
return 0
Expand All @@ -139,15 +140,16 @@ get_distro_specific_os_name() {
else
if [ -e /etc/os-release ]; then
. /etc/os-release
os=$(get_os_download_name_from_platform "$ID.$VERSION_ID" || echo "")
osName="${ID}${VERSION_ID:+.${VERSION_ID}}"
os=$(get_os_download_name_from_platform "${osName}" || echo "")
if [ -n "$os" ]; then
echo "$os"
return 0
fi
fi
fi

say_err "OS name could not be detected: $ID.$VERSION_ID"
say_err "OS name could not be detected: $osName"
return 1
}

Expand Down

0 comments on commit a0cdc60

Please sign in to comment.