forked from ss1121/FKP-REST
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathly
executable file
·187 lines (161 loc) · 2.68 KB
/
ly
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/bin/bash
# dev
dev(){
cd public
gulp dev
cd ..
if [ $1 ]; then
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js dev $1 &
else
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js dev &
fi
sleep 2
cd public
if [ $1='test' ]; then
gulp watch
else
if [ $1 ]; then
gulp watch --port $1
else
gulp watch
fi
fi
}
bbdev(){
cd public
gulp bbdev
cd ..
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js dev &
sleep 2
cd public
gulp watch
}
pro(){
cd public
gulp build
cd ..
if [ $1 ]; then
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js pro $1 &
else
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js pro &
fi
sleep 2
cd public
if [ $1='test' ]; then
gulp watch:pro
else
if [ $1 ]; then
gulp watch:pro --port $1
else
gulp watch:pro
fi
fi
# cd public
# gulp build
#
# cd ..
# nodemon -e js,jsx,css,html --ignore public/ --harmony index.js &
# sleep 2
#
# cd public
# gulp watch:pro
}
demo(){
cd public
gulp
}
ngdemo(){
cd public
gulp ng
}
ngdev(){
cd public
gulp ngdev
cd ..
nodemon -e js,jsx,css,html --ignore public/ --harmony index.js ngdev &
}
bbdemo(){
cd public
gulp bb
}
bbdemo(){
cd public
gulp bb
}
install2(){
# read -s -p "请输入sudo密码: " psd
# echo $psd | sudo npm install nrm -g
# nrm use cnpm
# sleep 3
# echo $psd | sudo npm install gulp -g
# echo $psd | sudo npm install nodemon -g
# echo $psd | sudo npm install node-gyp -g
sudo npm install nrm -g
nrm use cnpm
sleep 3
sudo npm install gulp -g
sudo npm install nodemon -g
sudo npm install node-gyp -g
}
install3(){
npm install nrm -g
nrm use cnpm
sleep 3
npm install gulp -g
npm install nodemon -g
npm install node-gyp -g
npm install
cd public
npm install
cd ..
}
install(){
install2
npm install
cd public
npm install
cd ..
}
server(){
nodemon -e js,jsx,css,html --ignore public/ --harmony index dev
}
build(){
cd public
gulp build
pm2 restart all
}
case $1 in
install)
install
;;
install2)
install2
;;
install3)
install3
;;
server)
server
;;
dev)
dev $2
;;
pro)
pro $2
;;
demo)
demo
;;
ngdemo)
ngdemo
;;
ngdev)
ngdev
;;
bbdemo)
bbdemo
;;
build)
build
;;
esac