forked from dipdowel/graph1_wasm_demo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwasm-release
More file actions
executable file
·29 lines (23 loc) · 1.05 KB
/
wasm-release
File metadata and controls
executable file
·29 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/bin/bash
# Clean up the old build
rm -rf ./pkg
# Compile
#RUSTFLAGS="--cfg=target_os=\"wasm32\"" wasm-pack build --target web --out-name graph1_web_demo -- --features web --no-default-features
#wasm-pack build --out-name graph1_web_demo
#RUSTFLAGS="--cfg=target_os=\"wasm32\"" wasm-pack build --target web --out-name graph1_web_demo --no-default-features
wasm-pack build --release --target web --out-name graph1_web_demo --no-default-features
# Make sure our custom `index.html` is there.
cp -R ./web-files/* ./pkg/
# Kill the previous PPython3 webserver, if any
#PID=$(ps aux | grep "python3 -m http.server 8080 --directory ./pkg/" | grep -v grep | awk '{print $2}')
PID=$(ps aux | grep "python3 graph1_demo_serve.py" | grep -v grep | awk '{print $2}')
if [[ -n "$PID" ]]; then
echo "Killing the old Python3 webserver process $PID"
kill -15 $PID
else
echo "No Python3 webserver process found"
fi
# Run a new Python3 webserver
echo "Starting a Python3 webserver for our WASM"
#python3 -m http.server 8080 --directory ./pkg/
python3 graph1_demo_serve.py