Skip to content

Commit

Permalink
fix: util.sha256 error code handling (#518)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored Feb 28, 2024
1 parent 970338d commit 75de7fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions oci/private/util.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def _sha256(rctx, path):
# on MacOS, but is not necessarily always available on Linux. OpenSSL is used as a final
# fallback if neither are available
result = rctx.execute(["shasum", "-a", "256", path])
if result.return_code == 127: # 127 return code indicates command not found
if result.return_code:
result = rctx.execute(["sha256sum", path])
if result.return_code == 127:
if result.return_code:
result = rctx.execute(["openssl", "sha256", "-r", path])
if result.return_code:
msg = "sha256 failed: \nSTDOUT:\n%s\nSTDERR:\n%s" % (result.stdout, result.stderr)
Expand Down

0 comments on commit 75de7fb

Please sign in to comment.