From 6f09aff97549fb9d2a3687781edf5d31dd766195 Mon Sep 17 00:00:00 2001 From: Gubolin Date: Sun, 7 Sep 2014 18:22:33 +0200 Subject: rewrite scripts --- mobile.sh | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) (limited to 'mobile.sh') diff --git a/mobile.sh b/mobile.sh index 656b7dc..789925a 100755 --- a/mobile.sh +++ b/mobile.sh @@ -1,21 +1,44 @@ #!/bin/bash +if [[ $1 = "" ]] +then + echo "Usage: mobile.sh PLATFORM [BUILDSOURCE]" + exit 0 +fi + # Requirements: # git, nodejs, android SDK / other platform(s) # cordova (https://cordova.apache.org/) # binaries are in platform/android/ant-build/Snap-debug.apk +if [[ $2 != "" ]] +then + copyfrom=$(readlink -e "$2") +fi + cordova create Snap-Mobile edu.berkeley.snap "Snap\!" cd Snap-Mobile rm -rf www config.xml -git clone https://github.com/Gubolin/snap.git www -cd www -git checkout mobileapp -cordova platform add android + +if [[ $2 == "" ]] +then + git clone https://github.com/Gubolin/snap.git www + cd www/ + git checkout mobileapp +else + cp -R "$copyfrom/" . + mv "$copyfrom" www + cd www +fi + +sed -i '/link rel="shortcut icon"/a\ + ' snap.html + +cordova platform add "$1" cordova plugin add org.apache.cordova.plugin.softkeyboard cordova plugin add org.apache.cordova.vibration cordova plugin add org.apache.cordova.device-motion cordova plugin add org.apache.cordova.device-orientation cordova plugin add org.apache.cordova.geolocation -cordova build android +cordova build "$1" -- cgit v1.3.1