Skip to content

Instantly share code, notes, and snippets.

@enykeev
Created June 18, 2015 04:46
Show Gist options
  • Save enykeev/e45613c916e79b912b4f to your computer and use it in GitHub Desktop.
Save enykeev/e45613c916e79b912b4f to your computer and use it in GitHub Desktop.
Control Gulp with stdio
gulp.task('watch', function() {
gulp.watch('static/*', ['static']);
gulp.watch('css/**/*.css', ['css']);
gulp.watch(['js/**/*.js'], ['lint', 'browserify']);
process.stdin.setEncoding('utf8');
process.stdin.on('readable', function() {
var chunk = process.stdin.read();
switch (chunk) {
case null:
gutil.log('This build system supports stdin commands');
break;
case 'test\n':
gulp.tasks.test.fn();
break;
default:
gutil.log('Unknown command');
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment