-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathinstall_cordova_ubuntu_platform.sh
executable file
·44 lines (25 loc) · 1.17 KB
/
install_cordova_ubuntu_platform.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
#!/bin/bash
SCRIPT_NAME=$(basename $BASH_SOURCE)
SCRIPT_LOGFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".log"
SCRIPT_ENVFILE="./logs/"$(basename -s .sh $BASH_SOURCE)".env"
mkdir -p ./logs && chmod 755 ./logs
echo "running "$SCRIPT_NAME
# tested: works on ubuntu 14.04.3 gnome
# see http://cordova.apache.org/docs/en/5.0.0/guide_platforms_ubuntu_index.md.html#Ubuntu%20Platform%20Guide
# see https://developer.ubuntu.com/en/apps/html-5/guides/cordova-guide/
if hash cordova 2>/dev/null; then
echo " check cordova => OK"
sudo add-apt-repository -y ppa:cordova-ubuntu/ppa &>> $SCRIPT_LOGFILE
sudo apt-get -y update &>> $SCRIPT_LOGFILE
sudo apt-get -y install cordova-cli &>> $SCRIPT_LOGFILE
echo ""
echo " Here is how to create and run a ubuntu hello world app:"
echo " cd ~/Desktop && cordova create hello-ubuntu com.example.hello HelloWorld && cd hello-ubuntu"
echo " cordova platform add ubuntu"
echo " !!! MAKE SURE YOU ADD THIS LINE IN config.xml: <icon src=\"/img/logo.png\"/> !!! WILL NOT WORK WITHOUT THIS"
echo " cordova build ubuntu"
echo " cordova run ubuntu"
echo ""
else
echo " check cordova => please install cordova first, then retry"
fi