-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart.sh
executable file
·62 lines (55 loc) · 1.1 KB
/
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#!/bin/bash
trap "trap - SIGTERM && kill 0" SIGINT SIGTERM EXIT
expo_build() {
cd frontend
pnpm web:build
cd ..
}
expo_start() {
cd frontend
pnpm start
cd ..
}
cargo_run_debug_proxy() {
cargo run -- --reverse-proxy
}
cargo_run_release() {
cargo run --release
}
usage() {
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " -h, --help Display this help message."
echo " -d, --dev Run in development mode."
echo " -r, --release Run in release mode."
}
handle_options() {
while [ $# -gt 0 ]; do
case $1 in
-h | --help)
usage
exit 0
;;
-d | --dev)
cargo_run_debug_proxy &
expo_start
;;
-r | --release)
expo_build
cargo_run_release
;;
*)
echo "Invalid option: $1" >&2
usage
exit 1
;;
esac
shift 1
done
}
if [ "$#" -eq 0 ];
then
usage
else
handle_options "$@"
fi