From 1b8d40dfc02c64db2ca334ecaacc10b20f0ce928 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Tue, 3 Sep 2024 12:18:03 -0400 Subject: [PATCH] chore: Fix error detection for missing Homebrew bottles --- scripts/fetch-brew-bottle.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-brew-bottle.sh b/scripts/fetch-brew-bottle.sh index 5046c78845..1ae91c3217 100755 --- a/scripts/fetch-brew-bottle.sh +++ b/scripts/fetch-brew-bottle.sh @@ -10,6 +10,7 @@ function get_gh_pkgs_token() { } function get_bottle_json() { + # echo "Getting bottle JSON for $1 $2" brew info --json=v1 "${1}" | jq ".[0].bottle.stable.files[\"${2}\"]" } @@ -53,8 +54,8 @@ BOTTLE_JSON=$(get_bottle_json "${BOTTLE_NAME}" "${BOTTLE_FILTER}") BOTTLE_URL=$(echo "${BOTTLE_JSON}" | jq -r .url) BOTTLE_SHA=$(echo "${BOTTLE_JSON}" | jq -r .sha256) -if [[ -z "${BOTTLE_URL}" ]] || [[ -z "${BOTTLE_SHA}" ]]; then - echo "Failed to identify bottle URL or SHA256!" >&2 +if [[ "${BOTTLE_URL}" == "null" ]] || [[ "${BOTTLE_SHA}" == "null" ]]; then + echo "Failed to identify bottle URL or SHA256! Bottle dropped from Homebrew?" >&2 exit 1 fi