From 30ed847531685a5ab2e4ed3c7927264df5164ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Wed, 13 Apr 2022 11:14:55 +0200 Subject: [PATCH] make fetch-bundles.sh portable. --- build/builtin-actors/fetch-bundles.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/build/builtin-actors/fetch-bundles.sh b/build/builtin-actors/fetch-bundles.sh index e36bd84bb..37b8e906e 100755 --- a/build/builtin-actors/fetch-bundles.sh +++ b/build/builtin-actors/fetch-bundles.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -cd $(dirname "$0") +cd "$(dirname "$0")" # gateway to use dweb="dweb.link" @@ -20,7 +20,7 @@ check() { file=$1 hash=$2 if [ -e "$file" ]; then - echo "$hash $file" | sha256sum --check + echo "$hash $file" | shasum -a 256 --check else return 1 fi @@ -30,22 +30,22 @@ fetch() { output=$1 cid=$2 hash=$3 - if (check $output $hash); then + if (check "$output" "$hash"); then return 0 else echo "fetching $cid to $output" - curl -k "https://$dweb/ipfs/$cid" -o $output - check $output $hash || die "hash mismatch" + curl -k "https://$dweb/ipfs/$cid" -o "$output" + check "$output" "$hash" || die "hash mismatch" fi } -if [ ! -z "$actors7_cid" ]; then +if [ -n "$actors7_cid" ]; then fetch builtin-actors-v7.car "$actors7_cid" "$actors7_hash" else touch builtin-actors-v7.car fi -if [ ! -z "$actors8_cid" ]; then +if [ -n "$actors8_cid" ]; then fetch builtin-actors-v8.car "$actors8_cid" "$actors8_hash" else touch builtin-actors-v8.car