Last active
August 29, 2015 14:05
-
-
Save ruyadorno/9f1ecb0aa48f1e1ec404 to your computer and use it in GitHub Desktop.
Get yeoman option from command-line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var yeoman = require('yeoman-generator'); | |
var argv = require('minimist')(process.argv.slice(2)); | |
module.exports = yeoman.generators.Base.extend({ | |
constructor: function (args, options) { | |
if (options['module-name']) { | |
// don't really remember why getting from argv with an options fallback | |
this.moduleName = argv['module-name'] || options['module-name']; | |
} else { | |
// calls inquirer and set the property in the usual way | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment