forked from rubenswebdev/scripts-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ubuntu_ionic_installer.sh
68 lines (52 loc) · 1.87 KB
/
ubuntu_ionic_installer.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
# Ubuntu Developer Script For Ionic Framework
# Created by Nic Raboy
# http://www.nraboy.com
#
# Updated by Rubens Fernnandes - 02-06-2015
# http://websix.com.br
#
#
# Downloads and configures the following:
#
# Java JDK
# Apache Ant
# Android
# NPM
# Apache Cordova
# Ionic Framework
HOME_PATH=$(cd ~/ && pwd)
INSTALL_PATH=~/
ANDROID_SDK_PATH=~/android-sdk
# x86_64 or i686
LINUX_ARCH="$(lscpu | grep 'Architecture' | awk -F\: '{ print $2 }' | tr -d ' ')"
# Latest Android Linux SDK for x64 and x86 as of 02-06-2015
ANDROID_SDK="https://dl.google.com/android/android-sdk_r24.0.2-linux.tgz"
#Desktop is default in linux English version, but in another language that folder not exist
cd ~/
wget "$ANDROID_SDK" -O "android-sdk.tgz"
tar zxf "android-sdk.tgz" -C "$INSTALL_PATH"
cd "$INSTALL_PATH" && mv "android-sdk-linux" "android-sdk"
# Android SDK requires some x86 architecture libraries even on x64 system
apt-get install -qq -y libc6:i386 libgcc1:i386 libstdc++6:i386 libz1:i386
cd "$INSTALL_PATH" && chown root:root "android-sdk" -R
cd "$INSTALL_PATH" && chmod 777 "android-sdk" -R
cd ~/
# Add Android and NPM paths to the profile to preserve settings on boot
echo "export PATH=\$PATH:$ANDROID_SDK_PATH/tools" >> ".profile"
echo "export PATH=\$PATH:$ANDROID_SDK_PATH/platform-tools" >> ".profile"
# Install JDK and Apache Ant
apt-get -qq -y install default-jdk ant
# Set JAVA_HOME based on the default OpenJDK installed
export JAVA_HOME="$(find /usr -type l -name 'default-java')"
if [ "$JAVA_HOME" != "" ]; then
echo "export JAVA_HOME=$JAVA_HOME" >> ".profile"
fi
curl -sL https://deb.nodesource.com/setup | sudo bash -
apt-get update
apt-get install -y nodejs
# Install Apache Cordova and Ionic Framework
npm install -g cordova
npm install -g ionic
echo "----------------------------------"
echo "Restart your Ubuntu session for installation to complete..."