-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (33 loc) · 997 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
var gulp = require('gulp');
var cp = require('child_process');
var runSequence = require('run-sequence');
gulp.task('default', function (cb) {
runSequence(
'serve',
'existence',
'kill-serve',
cb
);
});
gulp.task('serve', function (cb) {
cp.exec('cd ./output && python -m SimpleHTTPServer 8080', function (err, stdout, stderr) {
stdout && console.log(stdout);
stderr && console.log(stderr);
});
cb();
});
gulp.task('existence', function (cb) {
cp.exec('existence ./output', function (err, stdout, stderr) {
stdout && console.log(stdout);
stderr && console.log(stderr);
cb();
});
});
gulp.task('kill-serve', function (cb) {
cp.exec('kill $(ps aux | grep -v grep |grep -i "python -m SimpleHTTPServer 8080" | awk \'{print $2;}\')',
function (err, stdout, stderr) {
stdout && console.log(stdout);
stderr && console.log(stderr);
cb();
});
});