-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·41 lines (38 loc) · 1.24 KB
/
run.sh
File metadata and controls
executable file
·41 lines (38 loc) · 1.24 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
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
if [ $# -eq 0 ]; then
echo "Usage: $0 [wsl|wasm|lint|auto]"
echo "auto - Run the game via _cargo run with some debugging features"
echo "wsl - Run the game in WSL2 Environment"
echo "wasm - Run the game in web browser"
echo " Make sure you have installed [wasm-server-runner](https://github.com/jakobhellermann/wasm-server-runner)"
echo " via cargo install wasm-server-runner"
echo "lint - Runs Cargo Clippy and fmt"
exit 1
fi
platform=$1
case "$platform" in
"wsl")
clear
echo "Running Windows build commands in WSL..."
cargo build --features "debug" --target x86_64-pc-windows-gnu
cp target/x86_64-pc-windows-gnu/debug/shadow-runner.exe .
exec ./shadow-runner.exe "$@"
;;
"wasm")
clear
echo "Running WASM build commands..."
cargo run --features debug --target wasm32-unknown-unknown
;;
"lint")
clear && cargo fmt && cargo clippy --workspace --all-targets --all-features -- -Dwarnings
;;
"auto")
clear && cargo run --features debug
;;
*)
echo "Error: Unknown command. Use wsl, wasm, lint or auto"
echo ""
echo "`./run.sh`"
exit 1
;;
esac