-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmd.sh
More file actions
executable file
·61 lines (52 loc) · 1.44 KB
/
cmd.sh
File metadata and controls
executable file
·61 lines (52 loc) · 1.44 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
set -e
# set -x
export ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
EXEC_FILE=$0
help(){
echo "Usage:"
echo "$EXEC_FILE <action> [arguments]"
echo " r run android app"
echo " hs run prod webapp using local-web-server (installed globally)"
echo " so bundle.js source map explorer"
echo " rw run dev webapp"
echo " bw build prod webapp"
echo " bwp build webapp for publishing"
echo " em run webap/em/cmd.sh"
echo " cap record mp4"
}
build_web_app(){
[[ "$1" == "w" ]] && export USE_WASM=1;
cd webapp;
rm -rf dist;
npm run build;
}
ACTION="$1";
[[ -z "$ACTION" ]] && help;
shift;
cd $ROOT_DIR;
if [[ $ACTION == "r" ]] ; then
./run.sh $@; shift;
elif [[ $ACTION == "hs" ]] ; then
ws -d webapp/dist -z;
elif [[ $ACTION == "rw" ]] ; then
[[ "$1" == "w" ]] && export USE_WASM=1;
cd webapp; npm run dev;
elif [[ $ACTION == "bw" ]] ; then
build_web_app $@;
ls -la dist;
elif [[ $ACTION == "so" ]] ; then
cd webapp/dist;
source-map-explorer bundle.js --html > sme.html && open sme.html;
elif [[ $ACTION == "bwp" ]] ; then
export PUBLISH=1;
build_web_app $@;
cd dist && rm -rf css && find . -type f ! -name 'index.html' ! -name 'openh264.*' ! -name 'libav.*' -exec rm -f {} +;
ls -la;
elif [[ $ACTION == "em" ]] ; then
./webapp/em/cmd.sh $@
elif [[ $ACTION == "cap" ]] ; then
cd rec && node -r esm rec.js;
else
echo "Invalid action: $ACTION"
help
fi