forked from likerRr/code4goal-resume-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
37 lines (33 loc) · 974 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'),
run = require('gulp-run'),
gutil = require('gulp-util'),
spawn = require('child_process').spawn,
node;
/**
* $ gulp server
* description: launch the server. If there's a server already running, kill it.
*/
gulp.task('server', function () {
// set DEBUG=*
// set DEBUG=socket.io*
if (node) node.kill();
//console.log('-f "' + __dirname + '/resume/file.txt' + '"');
node = spawn('node', ['app.js', '-f', '"'+__dirname+'/public/resume.txt"'], {stdio: 'inherit'});
node.on('close', function (code) {
if (code === 8) {
gutil.log('Error detected, waiting for changes...');
}
});
});
gulp.task('default');
/**
* $ gulp
* description: start the development environment
*/
gulp.task('dev', ['server'], function () {
gulp.watch(['app.js', './src/**/**'], ['server']);
});
// clean up if an error goes unhandled.
process.on('exit', function () {
if (node) node.kill()
});