I want to define a tree of shell commands in my Gruntfile.js, using grunt-exec to write shell commands.
I can do this for a single command, but I can't figure out the syntax for writing multiple sets of commands, and being able to call them one-by-one, or in groups.
Could someone please provide a fully fleshed out example Gruntfile.js with the following task structure?
test: `npm test`
lint:
jshint: `jshint .`
csslint: `csslint .`
I'm coming from the world of make, so I really want to shove this workflow into my Node.js projects, damn the Node community conventions.
I want grunt to default to npm test
I want grunt lint to perform both jshint . and csslint .
I want grunt jshint to perform only jshint .
A grunt multi-task supports multiple targets, but they can't be nested. But you can register tasks that run other tasks.
Gruntfile.js:
Note that there are already a lot of grunt tasks available, like grunt-contrib-jshint, which make things much simpler.