-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.sh
executable file
·79 lines (68 loc) · 1.78 KB
/
run.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
# Build the SDRE Hub
# By default we build SDREHub as a web app (future will have a standalone app) and build as a debug version
# gather the command line options. Valid are `--web` and `--standalone` for the type of app to build
# and `--release` and `--debug` for the type of build to create
# default values
app_type="web"
build_type="debug"
clean=false
extra_args=()
# parse the command line options
while [ $# -gt 0 ]; do
case "$1" in
--web)
app_type="web"
;;
--standalone)
app_type="standalone"
;;
--release)
build_type="release"
;;
--debug)
build_type="debug"
;;
--clean)
clean=true
;;
*)
extra_args+=("$1")
;;
esac
shift
done
echo "Building SDRE Hub"
# clean the build directory
if [ "$clean" = true ]; then
echo "Cleaning the build directory"
cargo clean
fi
# output the build options
echo "App type: $app_type"
echo "Build type: $build_type"
# build the app
if [ "$app_type" == "web" ]; then
echo "Building SDRE Hub as a web app"
if [ "$build_type" == "debug" ]; then
echo "Building debug version"
# build the debug version
cargo run --bin sdre-hub -- "${extra_args[@]}"
else
echo "Building release version"
# build the release version
cargo run --release --bin sdre-hub -- "${extra_args[@]}"
fi
else
echo "Building SDRE Hub as a standalone app"
echo "Not yet implemented. Exiting"
if [ "$build_type" == "debug" ]; then
echo "Building debug version"
# build the debug version
cargo tauri dev
else
echo "Building release version"
# build the release version
cargo tauri build
fi
fi