-
Notifications
You must be signed in to change notification settings - Fork 1
/
ios.command
executable file
·37 lines (29 loc) · 1.06 KB
/
ios.command
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
#!/bin/bash
case $1 in development|production) export NODE_ENV=$1;; *) exit 64;; esac
case $(uname -s) in Darwin*) :;; *) exit 71;; esac
case $(which cfgutil) in /*) :;; *) exit 72;; esac
export APP=$(xpath config.xml '/widget/name/text()' | xargs)
export PATH=$PATH:$PWD/node_modules/.bin
mkdir -p www
npm install --also=development
cordova platform add [email protected]
cordova prepare ios
case $NODE_ENV in
development)
test -f settings-dev.json || sed -E \
-e "s|(\"profile\":) \"[^\"]+\"|\1 \"$NODE_ENV\"|" \
settings.json >settings-dev.json
trap 'test -n "$PID" && kill -0 $PID && pkill -P $PID' 0
while node -e 'done = require("fsevents").watch("www", () => done())'; do
if test -f www/index.html && cordova run ios && test -n "$APP"; then
test -n "$PID" && kill -0 $PID && pkill -P $PID
sh -c "cfgutil syslog | grep $APP" & PID=$!
fi
done &
ng run @wooportal/client:browser:$NODE_ENV --watch
;;
production)
ng run @wooportal/client:browser:$NODE_ENV
cordova build ios --device --release
;;
esac