aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bootstrap.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 66efb1d62..58eb9e9fb 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -29,8 +29,15 @@ vcpkgCheckRepoTool()
vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
+
+ SHASUM="shasum -a 512" # sha512sum is not available on osx
- actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx
+ # checking for sha512sum on os which doesn't have shasum
+ if which sha512sum >/dev/null 2>&1; then
+ SHASUM=sha512sum
+ fi
+
+ actualHash=$("$SHASUM" "$filePath")
actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word
if ! [ "$expectedHash" = "$actualHash" ]; then