Created
June 18, 2015 04:46
-
-
Save enykeev/e45613c916e79b912b4f to your computer and use it in GitHub Desktop.
Control Gulp with stdio
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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