mirror of
https://github.com/arkenfox/user.js.git
synced 2025-05-03 23:43:40 +02:00
Update updater.sh
make sure nothing spills into stdout because we use that to return the filename
This commit is contained in:
parent
2e8e57d31d
commit
d2029542a7
1 changed files with 4 additions and 3 deletions
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue