grunt icon indicating copy to clipboard operation
grunt copied to clipboard

Get queued task list

Open fredck opened this issue 10 years ago • 6 comments

The possibility to easily retrieve the list of task names in the queue.

Something like this:

grunt.registerTask('default', ['jscs:all', 'jshint']);

// When running `grunt`
grunt.task.queue;  // ['jscs:all', 'jshint'] 

// When running `grunt default`
grunt.task.queue;  // ['jscs:all', 'jshint'] 

// When running `grunt jshint`
grunt.task.queue;  // ['jshint'] 

// When running `grunt jshint:all`
grunt.task.queue;  // ['jshint:all'] 

fredck avatar Nov 27 '14 13:11 fredck

The reason behind this request is because of hacks we're doing with grunt that we're not proud of :D

fredck avatar Nov 27 '14 13:11 fredck

And interesting aspect of this feature is that the queue property should be "live". For example:

// When running `grunt`
grunt.task.queue;  // ['default']
grunt.registerTask('default', ['jscs', 'jshint']);
// `default` is replaced in `queue` automatically
grunt.task.queue;  // ['jscs', 'jshint']

More fancy:

// When running `grunt`
grunt.task.queue;  // ['default']
grunt.registerTask('lint', ['jscs', 'jshint']);
grunt.registerTask('default', ['lint', 'build']);
// all aliases get replace to their "final/real" tasks
grunt.task.queue;  // ['jscs', 'jshint','build']
// When running `grunt lint`
grunt.task.queue;  // ['lint']
grunt.registerTask('lint', ['jscs', 'jshint']);
grunt.task.queue;  // ['jscs', 'jshint']
grunt.task.run('build');
grunt.task.queue;  // ['jscs', 'jshint', 'build']

fredck avatar Dec 01 '14 13:12 fredck

+1 Interesting!

rybnik avatar Aug 24 '15 08:08 rybnik

Any updated on this? Very interesting..

abbondanza avatar Sep 02 '15 21:09 abbondanza

+1

davidosomething avatar Sep 17 '15 19:09 davidosomething

Any update on this?

toshitapandey avatar Dec 28 '18 06:12 toshitapandey