forked from jxcore/jxcore-cordova
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_and_run.sh
executable file
·38 lines (30 loc) · 1021 Bytes
/
install_and_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
#!/bin/bash
# The script automates creating cordova project and running on **posix** platforms:
# See https://github.com/jxcore/jxcore-cordova/blob/master/install_and_run.md
# Save it into an empty folder and run.
# create project
cordova create hello com.example.hello HelloWorld
cd hello
# get plugin
git clone https://github.com/jxcore/jxcore-cordova
# replace original sample if given
if [[ "$1" != "" ]]; then
DIR="./jxcore-cordova/sample/$1/www"
if [[ -d $DIR ]]; then
# escaping spaces in sample folder names
DIR=$(printf %q "$DIR")
eval cp -rf "${DIR}/*" ./www/ && echo "Copied '${DIR}' sample succesfully."
else
echo "Incorrect sample folder '${DIR}'."
read -p "Continue with default sample? [y/n] " answer
if [[ $answer != "y" ]]; then exit; fi
fi
fi
# add plugin to the project
cordova plugin add jxcore-cordova
# run on android
cordova platforms add android
cordova run android
# or run on ios
#cordova platforms add ios
#cordova run ios