generator-bas-basecontroller-gene
Version:
Basecontroller generator for ui5 apps
43 lines (37 loc) • 900 B
JavaScript
;
const Generator = require("yeoman-generator");
const chalk = require("chalk");
const yosay = require("yosay");
module.exports = class extends Generator {
prompting() {
// Have Yeoman greet the user.
this.log(
yosay(
`Welcome to the tiptop ${chalk.red(
"generator-bas-basecontroller-gene"
)} generator!`
)
);
const prompts = [
{
type: "confirm",
name: "someAnswer",
message: "Would you like to add Base controller?",
default: true
}
];
return this.prompt(prompts).then(props => {
// To access props later use this.props.someAnswer;
this.props = props;
});
}
writing() {
this.fs.copy(
this.templatePath("BaseController.js"),
this.destinationPath("ui5code/BaseController.js")
);
}
install() {
this.installDependencies();
}
};