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
This commit is contained in:
John Franey 2017-03-13 12:01:05 -03:00
parent 62214af49a
commit 8cc38490ed

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,13 +73,15 @@ 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);
});
});
// Browser sync server for live reload
gulp.task('browserSync', function() {
browserSync.init(