exit without output on failed download

in the case the provided access token doesn't have the appropriate permissions, exit without output. Otherwise, the downloaded files will not have the expected contents.
This commit is contained in:
benniekiss 2024-07-05 19:09:25 +00:00
parent 3772ac42c9
commit c1d31e18ab

View file

@ -149,7 +149,7 @@ download() {
cd $RELEASE_DIR
api GET repos/$REPO/releases/tags/$TAG > $TMP_DIR/assets.json
jq --raw-output '.assets[] | "\(.name) \(.browser_download_url)"' < $TMP_DIR/assets.json | while read name url ; do
curl -H "Authorization: token $TOKEN" -o $name -L $url
curl --fail -H "Authorization: token $TOKEN" -o $name -L $url
done
)
}