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

Commit 4856383

Browse files
author
jbeisner
committed
Fix an 'unbound variable' warning.
1 parent 5a5e35c commit 4856383

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/obtain/dotnet-install.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ get_linux_platform_name() {
157157

158158
get_current_os_name() {
159159
eval $invocation
160-
linux_platform_name="unknown"
161160

162161
local uname=$(uname)
163162
if [ "$uname" = "Darwin" ]; then
164163
echo "osx"
165164
return 0
166165
elif [ "$uname" = "Linux" ]; then
166+
local linux_platform_name
167167
linux_platform_name="$(get_linux_platform_name)" || { echo "linux" && return 0 ; }
168168

169169
if [[ $linux_platform_name == "rhel.6" || $linux_platform_name == "alpine.3.6" ]]; then
@@ -582,9 +582,10 @@ copy_files_or_dirs_from_list() {
582582
local root_path="$(remove_trailing_slash "$1")"
583583
local out_path="$(remove_trailing_slash "$2")"
584584
local override="$3"
585+
local osname="$(get_current_os_name)"
585586
local override_switch=$(
586587
if [ "$override" = false ]; then
587-
if [[ $linux_platform_name == 'alpine'* ]]; then
588+
if [[ "$osname" == 'alpine'* ]]; then
588589
printf -- "-u";
589590
else
590591
printf -- "-n";

0 commit comments

Comments
 (0)