Skip to content

Commit

Permalink
Use sha256sum if shasum is not available (closes #26)
Browse files Browse the repository at this point in the history
  • Loading branch information
gurukulkarni authored and smorimoto committed Jun 27, 2023
1 parent 25c03a5 commit a319792
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,15 @@ verify_checksum() {
local checksums_filename="$1"
(
cd "$(dirname "$checksums_filename")"
shasum -a 256 --check --ignore-missing --strict "$checksums_filename"
if command -v shasum >/dev/null; then
shasum -a 256 --check --ignore-missing --strict "$checksums_filename"
elif command -v sha256sum >/dev/null; then
sha256sum --check --ignore-missing --strict "$checksums_filename"
else
echo "Neither shasum nor sha256sum was found!"
exit 10
fi

)
}

Expand Down

0 comments on commit a319792

Please sign in to comment.