jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.96k stars 190 forks source link

Adds feature to allow tasks to be greedy, consuming all remaining CLI… #382

Open rdhallman opened 3 years ago

rdhallman commented 3 years ago

… parameters.

Jake already accepts parameters via the [arg1,arg2] syntax, but this syntax is verbose, spacing sensitive and zsh forces use of backslashes: \[arg1,arg2\]. I'd prefer to be able to do this:

$ jake build core plugins web-client

Instead of:

$ jake build\[core,plugins,web-client\]

With this commit, if a task is declared with greedy option set, it will consume all remaining CLI params as arguments:

task('build', {greedy: true}, function(...args) {
   jake.exec("yarn build " + args.join(" "), {stdout: true, stderr: true});
})