mirror of
https://github.com/kaboomserver/server.git
synced 2025-06-07 15:59:53 +00:00
fix: pass fetch output directly to jq
This commit is contained in:
parent
7ab9053a3b
commit
0f63164eab
1 changed files with 1 additions and 3 deletions
|
@ -4,16 +4,14 @@
|
||||||
|
|
||||||
_fetch_latest_build() {
|
_fetch_latest_build() {
|
||||||
builds_url="$1/builds"
|
builds_url="$1/builds"
|
||||||
|
|
||||||
debug "fetch: $builds_url"
|
debug "fetch: $builds_url"
|
||||||
BUILD_JSON="$(fetch -so- "$builds_url")"
|
|
||||||
|
|
||||||
# We have to read the variables like this because POSIX read
|
# We have to read the variables like this because POSIX read
|
||||||
# doesn't support reading multiple variables at a time
|
# doesn't support reading multiple variables at a time
|
||||||
for var in LATEST_BUILD LATEST_BUILD_FILENAME; do
|
for var in LATEST_BUILD LATEST_BUILD_FILENAME; do
|
||||||
read -r "${var?}"
|
read -r "${var?}"
|
||||||
done <<FETCH_LATEST_BUILD_HEREDOC
|
done <<FETCH_LATEST_BUILD_HEREDOC
|
||||||
$(echo "$BUILD_JSON" \
|
$(fetch -so- "$builds_url" \
|
||||||
| jq --raw-output --exit-status '.builds[-1] | "\(.build)\n\(.downloads?.application?.name)"')
|
| jq --raw-output --exit-status '.builds[-1] | "\(.build)\n\(.downloads?.application?.name)"')
|
||||||
FETCH_LATEST_BUILD_HEREDOC
|
FETCH_LATEST_BUILD_HEREDOC
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue