aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--scripts/bootstrap.sh12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 2225f029d..95ee75af1 100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -29,15 +29,15 @@ vcpkgCheckRepoTool()
vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
-
- SHASUM="shasum -a 512" # sha512sum is not available on osx
- # checking for sha512sum on os which doesn't have shasum
- if which sha512sum >/dev/null 2>&1; then
- SHASUM=sha512sum
+ if command -v "sha512sum" >/dev/null 2>&1 ; then
+ actualHash=$(sha512sum "$filePath")
+ else
+ # sha512sum is not available by default on osx
+ # shasum is not available by default on Fedora
+ actualHash=$(shasum -a 512 "$filePath")
fi
- actualHash=$("$SHASUM" "$filePath")
actualHash="${actualHash%% *}" # shasum returns [hash filename], so get the first word
if ! [ "$expectedHash" = "$actualHash" ]; then