Gulpfile child process spawn (#1074)

* Update gulpfile to use child_process.spawn

Use child_process.spawn in place of child_process exec to ensure that
console output is captured by Gulp.

Fixes #939

* Remove extra line
This commit is contained in:
John Franey 2017-06-07 12:46:20 -03:00 committed by Shupeyko Nikita
parent 46af6b4760
commit a286e32e2b

View File

@ -16,7 +16,7 @@ var gulp = require('gulp'),
pixrem = require('gulp-pixrem'),
uglify = require('gulp-uglify'),
imagemin = require('gulp-imagemin'),
exec = require('child_process').exec,
spawn = require('child_process').spawn,
runSequence = require('run-sequence'),
browserSync = require('browser-sync').create(),
reload = browserSync.reload;
@ -73,10 +73,11 @@ gulp.task('imgCompression', function(){
});
// Run django server
gulp.task('runServer', function() {
exec('python manage.py runserver', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
gulp.task('runServer', function(cb) {
var cmd = spawn('python', ['manage.py', 'runserver'], {stdio: 'inherit'});
cmd.on('close', function(code) {
console.log('runServer exited with code ' + code);
cb(code);
});
});