Pause for debugging
On complex projects, with numerous multitasks that display output, it occurred to me that you might want to be able to pause the task runner after each task. You may perhaps need to assess the output or check something, then decide whether or not to continue running the remaining tasks.
I’ve implemented a Grunt plugin (in a slightly unorthodox manner) to facilitate the pausing, “grunt-pause.js“. It uses the hooker to watch for task changes, then fires off a dynamically added task after each change. The inquirer node package then kicks in to prompt the developer to either continue (default), or clear the task queue and end the task runner.
Personally, I think this should be part of the Grunt core. It would be much easier to implement (not hooky hacky), and could be enabled simply with a “—pause” argument on the command line.
If this package gets used, I’ll consider a pull request to Grunt core for version 0.5.0. This package will still be useful for version 0.4.x etc.
Add the grunt-pause reference to the very top of your Gruntfile.js:
Add the pause init call at the top of the module.exports function of your Gruntfile.js::
Sample screenshot of the console output:
You might not want to have the pause between all tasks, perhaps we could pass an array of exclusions or inclusions when we call
As always, issues and pull request on the git repo.