-
Notifications
You must be signed in to change notification settings - Fork 4
/
develop.sh
executable file
·49 lines (36 loc) · 981 Bytes
/
develop.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
#!/bin/bash
# Name: develop.sh
# Purpose: creates a cordova project using the EmailComposer plugin
readonly script_path=`cd ${0%/*} && echo $PWD`
readonly script_name=${0##*/}
readonly app_name=HelloCordova
pushd "$script_path" > /dev/null
if [ -d "./$app_name" ]
then
rm -rf "./$app_name"
fi
which node >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo $script_name: node not installed, or not in PATH
exit 1
fi
which cordova >/dev/null 2>&1
if [ $? -ne 0 ]
then
echo $script_name: cordova cli not installed, or not in PATH
exit 2
fi
dir=`mktemp -d /tmp/$app_name-XXXXX`
mkdir -p "$dir"
set -x # verbose, expand variables
cordova create "$dir" || exit 3
pushd "$dir" > /dev/null || exit 4
cordova platforms add ios || exit 5
cordova plugin add "$script_path" || exit 6
cordova build || exit 7
#unset -x
popd >/dev/null
mv "$dir" "./$app_name"
open "./$app_name/platforms/ios/HelloCordova.xcodeproj"
exit 0