-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recipe: Compose tasks from the command line #410
Recipe: Compose tasks from the command line #410
Conversation
By exposing the functionality of run-sequence on the command line, you can compose tasks into arbitrary flow on an _ad hoc_ basis. This enables testing alternate flows which can quickly be captured in tasks if they prove useful.
Maybe you should split all of this logic out into a module that people can simply include vs. pasting all of this code into their gulpfile? |
Like you said, |
@ngConsulti I think the module still has merit if you want to pass custom sequences in via the CLI |
I'll give it some thought... On Tuesday, April 15, 2014, Eric Schoffstall [email protected]
Nathan Probst |
@contra, I took your advice. Here's the result: gulp-adhocInformation
NOTE: This module depends on UsageJust require gulpfile.jsvar gulp = require('gulp');
var gutil = require('gulp-util');
var runs = require('run-sequence');
require('gulp-adhoc')(gulp, gutil.env); CLI# Simple sequence
gulp clean,build,test,deploy
# Sequence with parallel sections
gulp clean,[coffee,less,jade],[min-css,min-js,min-img],inject BONUS!If you find yourself using the same ad hoc commands repeatedly, you can promote them to tasks like this... gulpfile.jsvar gulp = require('gulp');
var gutil = require('gulp-util');
var runs = require('run-sequence');
gulp.task('do-the-thing', function(done) {
runs(
'clean',
['coffee','less','jade'],
['min-css','min-js','min-img'],
'inject',
done);
}); |
@ngConsulti Cool, you should add this to the docs now since this module will be useful even with the new task system for taking this format in the CLI |
@ngConsulti Submit a new PR with a recipe for using this. Title the recipe something like "Complex Task Sequences" or something |
I came up with this recipe when I wanted to test out different stream topologies from the command line. Adding it as a recipe in case others find it useful...
Summary: