mirror of
https://github.com/kaboomserver/server.git
synced 2025-04-09 10:44:22 -04: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() {
|
||||
builds_url="$1/builds"
|
||||
|
||||
debug "fetch: $builds_url"
|
||||
BUILD_JSON="$(fetch -so- "$builds_url")"
|
||||
|
||||
# We have to read the variables like this because POSIX read
|
||||
# doesn't support reading multiple variables at a time
|
||||
for var in LATEST_BUILD LATEST_BUILD_FILENAME; do
|
||||
read -r "${var?}"
|
||||
done <<FETCH_LATEST_BUILD_HEREDOC
|
||||
$(echo "$BUILD_JSON" \
|
||||
$(fetch -so- "$builds_url" \
|
||||
| jq --raw-output --exit-status '.builds[-1] | "\(.build)\n\(.downloads?.application?.name)"')
|
||||
FETCH_LATEST_BUILD_HEREDOC
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue