aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap.sh')
-rw-r--r--[-rwxr-xr-x]scripts/bootstrap.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 66efb1d62..95ee75af1 100755..100644
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -30,7 +30,14 @@ vcpkgCheckEqualFileHash()
{
url=$1; filePath=$2; expectedHash=$3
- actualHash=$(shasum -a 512 "$filePath") # sha512sum not available on osx
+ 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="${actualHash%% *}" # shasum returns [hash filename], so get the first word
if ! [ "$expectedHash" = "$actualHash" ]; then
@@ -185,4 +192,4 @@ mkdir -p "$buildDir"
(cd "$buildDir" && "$cmakeExe" --build .)
rm -rf "$vcpkgRootDir/vcpkg"
-cp "$buildDir/vcpkg" "$vcpkgRootDir/" \ No newline at end of file
+cp "$buildDir/vcpkg" "$vcpkgRootDir/"