mirror of
https://github.com/chubin/wttr.in
synced 2025-01-11 19:48:45 +00:00
Update bash-function: Fix curl error
curl: (3) URL using bad/illegal format or missing URL
This commit is contained in:
parent
99a5f9995f
commit
3187f50504
1 changed files with 3 additions and 3 deletions
|
@ -21,11 +21,11 @@ fi
|
||||||
wttr() {
|
wttr() {
|
||||||
local location="${1// /+}"
|
local location="${1// /+}"
|
||||||
test "$#" -gt 0 && shift
|
test "$#" -gt 0 && shift
|
||||||
local args=""
|
local args=()
|
||||||
for p in $WTTR_PARAMS "$@"; do
|
for p in $WTTR_PARAMS "$@"; do
|
||||||
args+=" --data-urlencode $p "
|
args+=("--data-urlencode" "$p")
|
||||||
done
|
done
|
||||||
curl -fGsS -H "Accept-Language: ${LANG%_*}" $args --compressed "wttr.in/${location}"
|
curl -fGsS -H "Accept-Language: ${LANG%_*}" "${args[@]}" --compressed "wttr.in/${location}"
|
||||||
}
|
}
|
||||||
|
|
||||||
wttr "$@"
|
wttr "$@"
|
||||||
|
|
Loading…
Reference in a new issue