Fix `fetch-proxy` script on macos (#4112)

`sha256sum` is not installed by default. Use `openssl dgst -sha256` instead.
This commit is contained in:
Kevin Leimkuhler 2020-02-27 17:03:02 -08:00 committed by GitHub
parent 42349d6280
commit 44f1078498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -28,7 +28,11 @@ curl -sLO "$assetbase/$shafile"
tar -zxvf "$pkgfile" >&2
expected=$(awk '{print $1}' "$shafile")
computed=$(sha256sum "$pkgfile" | awk '{print $1}')
if [ $(uname) == "Darwin" ]; then
computed=$(openssl dgst -sha256 "$pkgfile" | awk '{print $2}')
else
computed=$(sha256sum "$pkgfile" | awk '{print $1}')
fi
if [ "$computed" != "$expected" ]; then
echo 'sha mismatch' >&2
exit 1