forked from linnovate/mean-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.sh
73 lines (60 loc) · 1 KB
/
start.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
69
70
71
72
73
#!/usr/bin/env bash
set -u
set_env(){
export dir_root=$(pwd)
export file_cfg=$dir_root/test/sh/config.cfg
export file_capture=$dir_root/test/sh/capture.sh
export address=0
if [ "$LOGNAME" = travis ];then
address='0.0.0.0:3000'
else
address='0.0.0.0:3001'
fi
test -f $file_capture
test -f $file_cfg
chmod +x $file_capture
source $file_cfg
}
test_self(){
sudo apt-get install -y -q curl
npm install bower
npm install -g
npm link
npm test
}
grunt_stuff(){
commander cat Gruntfile.js
commander grunt test || { exit 1; }
trace 'Running grunt now ..';
commander grunt &
}
user_instructions(){
commander npm install -g
commander npm link
commander env
commander mean status
commander grunt_stuff
}
test_navigation(){
while true; do curl $address 2>/dev/null && break ; sleep 1 ; done
}
test_mean_init(){
echo -e '\n\n' | mean init myApp
cd myApp
user_instructions
test_navigation
cd $dir_root
}
tests(){
test_self
test_mean_init
}
navigation(){
( bash -c $file_capture )
}
steps(){
set_env
tests
navigation
}
steps