forked from cb1kenobi/hyperloop
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.sh
executable file
·66 lines (57 loc) · 1.18 KB
/
setup.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
#!/bin/sh
#
# initial dev setup script
#
CWD=`pwd`
NAME=${NAME:=TiForward}
PREFIX="git clone [email protected]:$NAME/hyperloop"
ESC_SEQ="\x1b["
RESET=$ESC_SEQ"39;49;00m"
RED=$ESC_SEQ"31;01m"
GREEN=$ESC_SEQ"32;01m"
YELLOW=$ESC_SEQ"33;01m"
BLUE=$ESC_SEQ"34;01m"
MAGENTA=$ESC_SEQ"35;01m"
CYAN=$ESC_SEQ"36;01m"
GRAY=$ESC_SEQ"90;01m"
function colorize()
{
echo "$1$2"
}
function project()
{
if [ -d "hyperloop-$1" ]; then
colorize $YELLOW "Updating ${MAGENTA}hyperloop-$1$GRAY"
cd hyperloop-$1
git pull
else
colorize $YELLOW "Fetching ${MAGENTA}hyperloop-$1$GRAY"
${PREFIX}-$1.git
colorize $RESET ""
cd hyperloop-$1
fi
colorize $YELLOW "updating NPM libraries for ${MAGENTA}hyperloop-$1$GRAY"
result=`npm install 2>&1`
rm -rf node_modules/hyperloop-common
rm -rf node_modules/hyperloop-java
cd $CWD
colorize $RESET ""
}
project "common"
if [ ! -d "node_modules/hyperloop-common" ]; then
mkdir node_modules 2>/dev/null
cd node_modules
ln -s ../hyperloop-common
cd $CWD
fi
project "cli"
project "java"
if [ ! -d "node_modules/hyperloop-java" ]; then
mkdir node_modules 2>/dev/null
cd node_modules
ln -s ../hyperloop-java
cd $CWD
fi
project "android"
project "ios"
project "windows"