jakejs / jake

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

How to call jake --parameter in a jakefile? #254

Closed kud closed 10 years ago

kud commented 10 years ago

https://twitter.com/_kud/status/473828507534254081

The dirty way:

task('default', function() {
  jake.exec('jake --tasks', { interactive: true })
})
mde commented 10 years ago

Wait, I'm not sure what you're asking for here -- do you want a way to set the default task? Or are you asking how to pass CLI args to an embedded instance of Jake?

kud commented 10 years ago

Define the default task is just naming it 'default' but i would like to call jake "--tasks" function in a task, directly via JavaScript. On 3 Jun 2014 19:43, "Matthew Eernisse" notifications@github.com wrote:

Wait, I'm not sure what you're asking for here -- do you want a way to set the default task? Or are you asking how to pass CLI args to an embedded instance of Jake?

— Reply to this email directly or view it on GitHub https://github.com/mde/jake/issues/254#issuecomment-44996841.

mde commented 10 years ago

Ah, now I understand. Internally, the jake -T CLI command just calls jake.showAllTaskDescriptions. I've updated the doc here to indicate this: https://github.com/mde/jake#showing-the-list-of-tasks

kud commented 10 years ago

Thank you very well @mde ;)

kud commented 10 years ago

Works like a charm!

task('default', function() {
  jake.showAllTaskDescriptions()
})
kud commented 10 years ago

Even better:

task('default', jake.showAllTaskDescriptions)
mde commented 10 years ago

Excellent. :)