0
我正在建造一个yeoman发生器。我提示用户说出这样的项目:Yeoman发电机:我如何访问用户提供的选项?
SimplesiteGenerator.prototype.askFor = function askFor() {
var cb = this.async();
console.log(this.yeoman);
var prompts = [{
name: 'siteName',
message: 'What do you want to call your site?'
}];
this.prompt(prompts, function (props) {
this.siteName = props.siteName;
cb();
}.bind(this));
};
而且,我建立文件系统:
SimplesiteGenerator.prototype.app = function app() {
this.mkdir('app');
this.mkdir('app/templates');
this.mkdir('img');
我想被给出相同的目录中建立文件系统名称作为项目。我如何获得用户提供的选项并将其传递给应用程序?