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.
This commit is contained in:
KangarooCoder
2021-10-17 22:17:14 -05:00
committed by GitHub
parent 4af1c31edc
commit 417de103dd

View File

@@ -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
$SERVE_CMD $SERVE_ARGS