Commit 95373b46 authored by Mislav Marohnić's avatar Mislav Marohnić
Browse files

Avoid ERR trap activating if there's no `brew` command

When generating SHA2 checksums with `openssl`, we want to give
preference to the newer OpenSSL that might have been installed with
Homebrew. However if there's no `brew` command the ERR trap will kick in
and display the "BUILD FAILED" notice although the build would proceed
to run.

Related: c0dc8908

Fixes #713
parent 7f1d8df3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -208,7 +208,7 @@ compute_sha2() {
    output="$(shasum -a 256 -b)" || return 1
    echo "${output% *}"
  elif type openssl &>/dev/null; then
    local openssl="$(command -v "$(brew --prefix openssl 2>/dev/null)"/bin/openssl openssl | head -1)"
    local openssl="$(command -v "$(brew --prefix openssl 2>/dev/null || true)"/bin/openssl openssl | head -1)"
    output="$("$openssl" dgst -sha256 2>/dev/null)" || return 1
    echo "${output##* }"
  elif type sha256sum &>/dev/null; then