-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bash_profile
62 lines (46 loc) · 930 Bytes
/
.bash_profile
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
function amobile() {
local COMMAND_NAME
local SCRIPT_DIR
# -- helper functions
function varName {
# everything to upper case and dash to underscore
echo ${1//-/_} | tr '[:lower:]' '[:upper:]'
}
# setVar(varName, varValue)
function setVar {
eval "$1=\"$2\""
}
function init {
echo "cordova aurelia app initialization"
mkdir -p "www"
mkdir -p "platforms"
mkdir -p "plugins"
npm install
cordova prepare
}
function runAndroid {
echo "start app on android emulator"
rm -rf ./www/*
npm start -- build
cordova run android
}
function runIos {
echo "start app on ios emulator"
rm -rf ./www/*
}
SCRIPT_DIR=$(pwd)
COMMAND_NAME=$(varName "$@")
case "$COMMAND_NAME" in
INIT)
init
;;
RUN_ANDROID)
runAndroid
;;
RUN_IOS)
runIos
;;
*) echo "invalid command"
;;
esac
}