Пытаюсь написать генератор. Он приостановился после печати app name
в терминале.
Как разрешить ему выполнение действия copyFile
?
var Generator = require('yeoman-generator');
module.exports = class extends Generator {
// The name `constructor` is important here
constructor(args, opts) {
// Calling the super constructor is important so our generator is correctly set up
super(args, opts);
this.argument("proname", {
type: String,
required: true
});
}
askFor() {
const done = this.async();
this.prompt([{
type: "input",
name: "name",
message: "Your crx name",
default: 'myCrx' // Default to current folder name
}, {
name: 'description',
message: 'How would you like to describe this extension?',
default: 'My Chrome Extension'
}
]).then(function (answers){
this.log("app name", answers.name);
this.name = answers.name.replace(/\"/g, '\\"');
done();
}.bind(this));
}
copyFile() {
this.log('Creating templates');
this.fs.copy(
this.templatePath('./'),
this.destinationPath('./' + this.options.proname)
);
}
};