-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (32 loc) · 861 Bytes
/
gulpfile.js
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
const { watch, series, parallel } = require('gulp');
const shell = require('shelljs');
const signale = require('signale');
const chalk = require('chalk');
function check(cb) {
var daemon_list = [
'etc/daemon.config.yml',
'etc/daemon.download.sh',
'etc/daemon.trade.sh',
'etc/daemon.wechatflask.sh'
]
var status = shell.find(daemon_list);
if (status.code !== 0) {
throw new Error('Missing', status.stderr);
}
cb();
}
function main(cb) {
shell.exec('pm2 start etc/daemon.config.yml',{silent:true});
cb();
}
function prettymsg(cb) {
signale.star('Enjoy Yourself!');
signale.note('pm2 status => Show Status');
cb();
}
function clean(cb) {
shell.exec('pm2 delete all',{silent:true});
cb();
}
exports.start = series(check, main, prettymsg)
exports.clean = series(clean)