Dica-Developer / generator-node-webkit

Yeoman generator for nwjs applications
MIT License
282 stars 40 forks source link

Would be nice if generator allowed options instead of prompts #80

Closed sambaker closed 9 years ago

sambaker commented 9 years ago

I'd like to call your generator from a generator of my own using composeWith('node-webkit'). I tried that but then my generator's prompts get interrupted with prompts from your generator. I've already requested that the user enter their app name so I would like to pass appName into the node-webkit generator instead of the user seeing two different prompts for the same value and things not working if they enter a different response for each prompt.

When utilizing another generator using composeWith, you can pass values for options but not for prompts. See this thread for a discussion: https://github.com/yeoman/generator/issues/552

So while this is not documented on the yeoman site, the standard practice for generators that may end up being used with composition, should be the method suggested in that thread: check for option('appName') and if it doesn't exist, add the prompt for appName. That way I can forward options to your generator and have it operate as I want silently.

Since this isn't possible currently, I'm only using your generator for the download part, with composeWith('node-webkit:download') and I have copies of the Gruntfile and resources/mac folder in my generator's repo, which is fragile and not likely to work when you guys make changes to your generator.

If you approve of this change, I'm happy to create a pull request.

mschaaf commented 9 years ago

We are currently working on a rewrite for version 2.0.0 in the branch sparrow and would like to include a pull request for this from you.

sambaker commented 9 years ago

Ok great, I'll take a look at the sparrow branch - thanks.

sambaker commented 9 years ago

Here you go, PR submitted. Do you have a schedule for the v2 release?

mschaaf commented 9 years ago

Thanks for the pull request we will review it and no we don't have a schedule. It all depends on how fast we get the old functionality ported.

mschaaf commented 9 years ago

Thank you for your patch its now merged.