Use shasum instead of sha256sum [skip ci] (#861)

sha256sum is not available in macOS by default.

See: https://github.com/ESGF/esg-search/issues/84#issuecomment-213694850

However, shasum seems to be avaialble, so use that instead.
This commit is contained in:
Thiago Kenji Okada 2021-05-21 11:52:38 -03:00 committed by GitHub
parent 512a6f2220
commit 20cc3b4cdd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,9 +118,9 @@ rm -rf "$filename"
rm -rf "bb"
curl -o "$filename" -sL "$download_url"
if [[ -n "$checksum" ]]; then
if ! echo "$checksum $filename" | sha256sum --check --status; then
if ! echo "$checksum *$filename" | shasum -a 256 --check --status; then
>&2 echo "Failed checksum on $filename"
>&2 echo "Got: $(sha256sum "$filename" | cut -d' ' -f1)"
>&2 echo "Got: $(shasum -a 256 "$filename" | cut -d' ' -f1)"
>&2 echo "Expected: $checksum"
exit 1
fi