From 417de103ddadc3243a2918add286cb1cfd18d8c0 Mon Sep 17 00:00:00 2001 From: KangarooCoder Date: Sun, 17 Oct 2021 22:17:14 -0500 Subject: [PATCH] Correct bash env and sed command (#2066) On MacOS Big Sur Version 11.6 the script fails because 1) it does #!/bin/env bash instead of #!/usr/bin/env bash and 2) the sed's -i option takes a file extension or "" which I have opted for the latter. With these changes, the script now works as expected. --- run-wasm-example.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run-wasm-example.sh b/run-wasm-example.sh index d2dd3acc78..b635b71dc9 100755 --- a/run-wasm-example.sh +++ b/run-wasm-example.sh @@ -1,4 +1,4 @@ -#!/bin/env bash +#!/usr/bin/env bash set -e @@ -9,7 +9,7 @@ echo "Generating bindings..." mkdir -p target/wasm-examples/$1 wasm-bindgen --target web --out-dir target/wasm-examples/$1 target/wasm32-unknown-unknown/debug/examples/$1.wasm cp wasm-resources/index.template.html target/wasm-examples/$1/index.html -sed -i "s/{{example}}/$1/g" target/wasm-examples/$1/index.html +sed -i "" "s/{{example}}/$1/g" target/wasm-examples/$1/index.html # Find a serving tool to host the example SERVE_CMD="" @@ -31,4 +31,4 @@ if [ "$SERVE_CMD" = "" ]; then fi echo "Serving example with $SERVE_CMD at http://localhost:1234" -$SERVE_CMD $SERVE_ARGS \ No newline at end of file +$SERVE_CMD $SERVE_ARGS