From 44f107849848c4914de91e60a4a0d14a8162f92d Mon Sep 17 00:00:00 2001 From: Kevin Leimkuhler Date: Thu, 27 Feb 2020 17:03:02 -0800 Subject: [PATCH] Fix `fetch-proxy` script on macos (#4112) `sha256sum` is not installed by default. Use `openssl dgst -sha256` instead. --- bin/fetch-proxy | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/fetch-proxy b/bin/fetch-proxy index 3156de64e..34ee92a95 100755 --- a/bin/fetch-proxy +++ b/bin/fetch-proxy @@ -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