-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstart.sh
executable file
·28 lines (22 loc) · 924 Bytes
/
start.sh
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
# Starts the dev servers.
# They will rebuild and restart automatically as you make changes to files.
# Once the build is complete, the app will be running on http://localhost:8080/
# When this shell script exits, kill all child jobs.
trap 'kill $(jobs -p)' EXIT
if test -d "www/node_modules"; then
echo 'skipping npm install'
else
(cd www && npm ci)
fi
# Start the web devserver
cd www/
npx wds --watch --open >/dev/null &
cd ../
# Make sure cargo-watch is installed
cargo install cargo-watch
# Start the websocket server, and rebuild and relaunch it as necessary.
cd server/
cargo watch -x 'run --bin dev' -w src/ -w Cargo.toml -w ../core/src/ -w ../core/Cargo.toml &
# Rebuild the client wasm binary each time the filesystem is changed.
cd ../client
cargo watch -s 'wasm-pack build --target web --dev && rm -rf ../www/wasm && cp -r ./pkg ../www/wasm' -w src/ -w Cargo.toml -w ../core/src/ -w ../core/Cargo.toml