gruntjs / grunt-init

Generate project scaffolding from a template.
http://gruntjs.com/project-scaffolding
MIT License
194 stars 59 forks source link

Add keywords and npm_install prompts, two helpers #69

Closed gamtiq closed 10 years ago

gamtiq commented 10 years ago

Hello,

I have added:

vladikoff commented 10 years ago

Thanks for the PR @gamtiq! Give us some time to test and give feedback.

vladikoff commented 10 years ago

Hey @gamtiq sorry for the slow response. Just tested this and this seems cool. One thing, would it be better to have init.runNpmInstall(props.npm_install); and leave the done to the template? runNpmInstall might not be the final step in the scaffolding.

Let me know if you wanna update this and I will reopen.

gamtiq commented 10 years ago

Hello @vladikoff,

Do you mean that:

  1. runNpmInstall should have the following signature: init.runNpmInstall(required, done) where both parameters are optional?
  2. required parameter should not have true as default value? If so, I can change the implementation.
vladikoff commented 10 years ago

Yea so we should be able to use init.runNpmInstall() and that would by default run npm install. And also use it this way:

init.runNpmInstall(props.npm_install)
somethingElse()
done()
gamtiq commented 10 years ago

I have made the change. Now it is possible to use runNpmInstall as you wrote:

init.runNpmInstall(props.npm_install)
somethingElse()
done()

Or by this way:

init.runNpmInstall(props.npm_install, function() {
    // The following code will be run in any case but after finishing of "npm install" if props.npm_install is true
    somethingElse();
    done();
});
vladikoff commented 10 years ago

Thanks! :dart: