Gulpfile child process spawn
* 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
* Remove extra line
@@ -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);
});
});
