Skip to content

Commit

Permalink
Correct bash env and sed command (#2066)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
KSBilodeau authored Oct 18, 2021
1 parent 4af1c31 commit 417de10
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions run-wasm-example.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/env bash
#!/usr/bin/env bash

set -e

Expand All @@ -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=""
Expand All @@ -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

0 comments on commit 417de10

Please sign in to comment.