Skip to content

Commit beb429b

Browse files
committed
Automate Rust and wasm-pack installation in build script
The build.sh script now installs Rust and wasm-pack automatically before building the WebAssembly module. This streamlines the setup process and replaces manual installation instructions with automated steps.
1 parent 0aa9c6d commit beb429b

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

orphos-wasm/build.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
#!/bin/bash
22
set -e
33

4-
echo "Building Orphos WebAssembly module..."
4+
# Install Rust
5+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
6+
source $HOME/.cargo/env
57

6-
# Check if wasm-pack is installed
7-
if ! command -v wasm-pack &> /dev/null; then
8-
echo "Error: wasm-pack is not installed."
9-
echo "Install it with: cargo install wasm-pack"
10-
exit 1
11-
fi
8+
# Install wasm-pack
9+
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
1210

1311
# Build the WASM module
1412
echo "Compiling Rust to WebAssembly..."
1513
wasm-pack build --target web --out-dir www/pkg
16-
17-
echo "✓ Build complete!"
18-
echo ""
19-
echo "To start the development server, run:"
20-
echo " cd prodigal-wasm && npm run serve"
21-
echo ""
22-
echo "Then open http://localhost:8080 in your browser"
14+
npm run build:release

0 commit comments

Comments
 (0)