refactor: Clarify why name is read out last from assets.json

This commit is contained in:
Felix Kröner 2024-12-08 22:52:20 +01:00
parent 50f803ce6a
commit 4308ed0075

View file

@ -172,7 +172,7 @@ download() {
echo "Downloading tagged release ${TAG}" echo "Downloading tagged release ${TAG}"
api GET repos/$REPO/releases/tags/"$TAG" > "$TMP_DIR"/assets.json api GET repos/$REPO/releases/tags/"$TAG" > "$TMP_DIR"/assets.json
fi fi
jq --raw-output '.assets[] | "\(.browser_download_url) \(.name)"' < "$TMP_DIR"/assets.json | while read url name ; do jq --raw-output '.assets[] | "\(.browser_download_url) \(.name)"' < "$TMP_DIR"/assets.json | while read url name ; do # `name` may contain whitespace, therefore, it must be last
curl --fail -H "Authorization: token $TOKEN" -o "$name" -L "$url" curl --fail -H "Authorization: token $TOKEN" -o "$name" -L "$url"
done done
) )