Skip to content

Commit

Permalink
Short circuit execution for linux binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-manges committed Feb 27, 2024
1 parent 858a8c9 commit f4fed1b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/update-abq-formulae
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ function getSHA() {
curl --user-agent "${fake_user_agent}" "${url}" -o ./tmp/abq.tar --fail-with-body --silent -L
sha=$(sha256sum ./tmp/abq.tar | cut -d ' ' -f 1)

if [[ "$url" == *"linux"* ]]; then
echo "${sha}"
return
fi

(cd tmp && tar -xvf abq.tar && mv abq_*/abq ./ && cd -) &>/dev/null
chmod +x ./tmp/abq
output=$(./tmp/abq --version)
Expand Down
5 changes: 5 additions & 0 deletions bin/update-captain-formulae
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function getSHA() {
curl "${url}" -o ./tmp/captain --fail-with-body --silent -L
sha=$(sha256sum ./tmp/captain | cut -d ' ' -f 1)

if [[ "$url" == *"linux"* ]]; then
echo "${sha}"
return
fi

chmod +x ./tmp/captain
output=$(./tmp/captain --version)
if ! (echo "${output}" | grep "v${expectedVersion}" &>/dev/null); then
Expand Down
5 changes: 5 additions & 0 deletions bin/update-mint-formulae
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ function getSHA() {
curl "${url}" -o ./tmp/mint --fail-with-body --silent -L
sha=$(sha256sum ./tmp/mint | cut -d ' ' -f 1)

if [[ "$url" == *"linux"* ]]; then
echo "${sha}"
return
fi

chmod +x ./tmp/mint
output=$(./tmp/mint --version)
if ! (echo "${output}" | grep "v${expectedVersion}" &>/dev/null); then
Expand Down

0 comments on commit f4fed1b

Please sign in to comment.