From 35342a258dfde4d5d981d2686ec970b47a621f93 Mon Sep 17 00:00:00 2001 From: Simon Willison Date: Wed, 10 May 2023 10:14:04 -0700 Subject: [PATCH] Fix run_me.sh to work on macOS --- python/examples/bindings/se2-bindings/run_me.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/python/examples/bindings/se2-bindings/run_me.sh b/python/examples/bindings/se2-bindings/run_me.sh index c24e69f0..23c56944 100755 --- a/python/examples/bindings/se2-bindings/run_me.sh +++ b/python/examples/bindings/se2-bindings/run_me.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash if [[ "$1" == "--local" ]]; then - if [[ ! -v WASI_SDK_PATH ]]; then + if [ -z "${WASI_SDK_PATH}" ]; then echo "WASI_SDK_PATH is required. Download wasi-sdk and set the variable" exit 1 fi @@ -32,15 +32,15 @@ fail() { } echo -e "\n\n------------------------------------" | tee -a build.log -echo "$(date --iso-8601=ns) Running '$0'" | tee -a build.log +echo "$(date +%Y-%m-%dT%H:%M:%S.%6NZ) Running '$0'" | tee -a build.log -echo -e "$(date --iso-8601=ns) | Building wasm-wrapper-c ${WASI_CMD:+with '$WASI_CMD' }(logs silenced to build.log)..." | tee -a build.log +echo -e "$(date +%Y-%m-%dT%H:%M:%S.%6NZ) | Building wasm-wrapper-c ${WASI_CMD:+with '$WASI_CMD' }(logs silenced to build.log)..." | tee -a build.log ${WASI_CMD} bash -c "cd wasm-wrapper-c; ./build-wasm.sh --clean >>../build.log 2>&1" || fail -echo -e "$(date --iso-8601=ns) | Building se2-mock-runtime ${NODE_CMD:+with '$NODE_CMD' }(logs silenced to build.log)..." | tee -a build.log +echo -e "$(date +%Y-%m-%dT%H:%M:%S.%6NZ) | Building se2-mock-runtime ${NODE_CMD:+with '$NODE_CMD' }(logs silenced to build.log)..." | tee -a build.log ${NODE_CMD} bash -c "cd se2-mock-runtime; npm i >>../build.log 2>&1" || fail -echo -e "$(date --iso-8601=ns) | Running se2-mock-runtime ${NODE_CMD:+with '$NODE_CMD' }..." | tee -a build.log +echo -e "$(date +%Y-%m-%dT%H:%M:%S.%6NZ) | Running se2-mock-runtime ${NODE_CMD:+with '$NODE_CMD' }..." | tee -a build.log ${NODE_CMD} bash -c "cd se2-mock-runtime; set -x; \ node --experimental-wasi-unstable-preview1 . \ --wrapper ../wasm-wrapper-c/target/wasm32-wasi/wasm-wrapper-c.wasm \