From 9fe369a1e7e1d787cd815a6c7cf9cdb6b8a0b305 Mon Sep 17 00:00:00 2001 From: Stefan Date: Wed, 22 Jun 2022 11:54:38 +0200 Subject: [PATCH] chore(Build): raise awareness of brew download failed --- scripts/fetch-brew-bottle.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-brew-bottle.sh b/scripts/fetch-brew-bottle.sh index 1f6c7b5972..06e79fd614 100755 --- a/scripts/fetch-brew-bottle.sh +++ b/scripts/fetch-brew-bottle.sh @@ -3,8 +3,10 @@ set -eof pipefail # This script is used to fetch HomeBrew bottles for PCRE and OpenSSL. +trap "echo 'Failed to download bottle. Check your authentication token and network connection.'" EXIT ERR INT QUIT + function get_gh_pkgs_token() { - curl --fail -Ls -u "${GITHUB_USER}:${GITHUB_TOKEN}" https://ghcr.io/token | jq -r '.token' + curl --fail --show-error -Ls -u "${GITHUB_USER}:${GITHUB_TOKEN}" https://ghcr.io/token | jq -r '.token' } function get_bottle_json() { @@ -20,7 +22,7 @@ function fetch_bottle() { else AUTH=("-u" "_:_") # WARNING: Unauthorized requests can be throttled. fi - curl --fail -Ls "${AUTH[@]}" -o "${1}" "${2}" + curl --fail --show-error -Ls "${AUTH[@]}" -o "${1}" "${2}" } if [[ $(uname) != "Darwin" ]]; then