Update updater.sh

make sure nothing spills into stdout because we use that to return the filename
This commit is contained in:
earthlng 2018-11-23 01:39:20 +00:00 committed by GitHub
parent 2e8e57d31d
commit d2029542a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -131,14 +131,15 @@ fi
download_file () { download_file () {
declare -r url=$1 declare -r url=$1
declare -r tf=$(mktemp) declare -r tf=$(mktemp)
local dlcmd=""
if [ $DOWNLOAD_METHOD = "curl" ]; then if [ $DOWNLOAD_METHOD = "curl" ]; then
curl -o $tf "${url}" dlcmd="curl -o $tf"
else else
wget -O $tf "${url}" dlcmd="wget -O $tf"
fi fi
echo "$tf" # return the temp-filename $dlcmd "${url}" >/dev/null && echo "$tf" || echo "" # return the temp-filename (or empty string on error)
} }