Browse Source

use gnu-sed on mac in runtime shasum script

Mokhtar Naamani 3 years ago
parent
commit
efd4907d07
2 changed files with 6 additions and 4 deletions
  1. 5 3
      scripts/runtime-code-shasum.sh
  2. 1 1
      setup.sh

+ 5 - 3
scripts/runtime-code-shasum.sh

@@ -8,8 +8,10 @@ export WORKSPACE_ROOT=`cargo metadata --offline --no-deps --format-version 1 | j
 cd ${WORKSPACE_ROOT}
 
 TAR=tar
+SED=sed
 if [[ "$OSTYPE" == "darwin"* ]]; then
-	TAR=gtar
+  TAR=gtar
+  SED=gsed
 fi
 
 export TEST_NODE_BLOCKTIME=1000
@@ -23,9 +25,9 @@ ${TAR} -c --sort=name --owner=root:0 --group=root:0 --mode 644 --mtime='UTC 2020
     runtime-modules \
     utils/chain-spec-builder \
     joystream-node.Dockerfile \
+    joystream-node-armv7.Dockerfile \
     node \
     $(test -n "$TEST_NODE" && echo "$TEST_PROPOSALS_PARAMETERS_PATH") \
-    joystream-node-armv7.Dockerfile \
-    | if [[ -n "$TEST_NODE" ]]; then sed '$a'"$TEST_NODE_BLOCKTIME"; else tee; fi \
+    | if [[ -n "$TEST_NODE" ]]; then ${SED} '$a'"$TEST_NODE_BLOCKTIME"; else tee; fi \
     | shasum \
     | cut -d " " -f 1

+ 1 - 1
setup.sh

@@ -19,7 +19,7 @@ elif [[ "$OSTYPE" == "darwin"* ]]; then
     fi
     # install additional packages
     brew update
-    brew install coreutils gnu-tar jq curl llvm || :
+    brew install coreutils gnu-tar jq curl llvm gnu-sed || :
     echo "It is recommended to setup Docker desktop from: https://www.docker.com/products/docker-desktop"
     echo "It is also recommended to install qemu emulators with following command:"
     echo "docker run --privileged --rm tonistiigi/binfmt --install all"