Use ${var:?} to ensure this never expands to /* .

https://github.com/koalaman/shellcheck/wiki/SC2115
This commit is contained in:
Eric Nemchik 2018-02-28 10:28:35 -06:00
commit 1015fe5184

View file

@ -99,7 +99,7 @@ unzip-strip() (
cp -r "$temp"/*/* "$dest"
else
cp -r "$temp"/* "$dest"
fi && rm -rf "$temp"/* "$temp"
fi && rm -rf "${temp:?}"/* "$temp"
)
# Import any custom config to override the defaults, if necessary
@ -314,7 +314,7 @@ else
fi
.log 6 "Cleaning up..."
rm -rf "$tempdir"/* "$tempdir"
rm -rf "${tempdir:?}"/* "$tempdir"
declare -i elapsedtime=$SECONDS
declare -i minutes=0
declare -i seconds=0
@ -334,4 +334,4 @@ elif [ $seconds -eq 1 ]; then
fi
durationmsg="Update complete...elapsed time $duration..."
durationmsg="${durationmsg// / }"
.log 6 "$durationmsg"
.log 6 "$durationmsg"