Dica-Developer / generator-node-webkit

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

Make all prompts optional. #81

Closed sambaker closed 9 years ago

sambaker commented 9 years ago

If options are passed in via command-line args or a composeWith parameter, then those options will be used and the corresponding prompts will be skipped.

sambaker commented 9 years ago

This addresses issue #80. It uses a new npm package that I created, https://github.com/artefact-group/yeoman-option-or-prompt to only prompt for params that haven't been supplied as options. The options can be passed in via the command line or via the options parameter in the yeoman composeWith call.

All options are also forwarded to sub-generators so that you can supply options for those on the command line too.

An example command line that skips various prompts after my changes would be:

yo node-webkit --appname=MonkeyTeeth --description="I am an app about FEROCIOUS MONKEY TEETH" --examples= --downloadversion=v0.12.0

downloadversion is passed on to the node-webkit:download generator, the others are used by the main generator.

Note that I renamed the version parameter in node-webkit:download to downloadversion. That was only necessary for the command line options to work, because calling

yo node-webkit --version=v0.12.0

would return the version of yo instead of creating the version option for the node-webkit generator.

mschaaf commented 9 years ago

Thank you.