1$env.SERVER_URL = "ws://localhost:3111"
2
3def build-web [run: bool] {
4 mut cmd = ["cargo" "run-wasm" "--package" "annoyance" "--features" "client" "--release"]
5 if not $run { $cmd = $cmd ++ ["--build-only"] }
6 run-external $cmd
7}
8
9def build-native [feat: string, run: bool] {
10 let dir = pwd | path join $"($feat)-build"
11 cargo b --release --features $feat --artifact-dir $dir -Z unstable-options
12 if $run {
13 exec ($dir | path join "annoyance.exe")
14 }
15}
16
17def main [feat: string = "server", --run (-r), --web (-w)] {
18 if $web {
19 build-web $run
20 } else {
21 build-native $feat $run
22 }
23}