Skip to content

Commit 681af9e

Browse files
committed
Fix wasm-pack not found error
1 parent a87c22c commit 681af9e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

frontend/scripts/install.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,24 @@ fi
1717
# wasm-pack
1818
# wasm-pack will be installed by npm package
1919
# https://rustwasm.github.io/wasm-pack/installer/
20-
# if ! hash wasm-pack 2>/dev/null; then
21-
# curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
22-
# fi
20+
if ! hash wasm-pack 2>/dev/null; then
21+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
22+
fi
23+
24+
# copy wasm-pack
25+
destination="$HOME/.config/wasm-pack-nodejs/bin"
26+
source=$(which wasm-pack)
27+
if [ -z "$source" ]; then
28+
echo "wasm-pack is not installed or not found in PATH"
29+
else
30+
echo "$source"
31+
if [ -d "$destination" ]; then
32+
cp "$source" "$destination"
33+
else
34+
mkdir -p "$destination"
35+
cp "$source" "$destination"
36+
fi
37+
fi
2338

2439

2540
# yarn

0 commit comments

Comments
 (0)