Last active
January 10, 2021 19:47
-
-
Save iksena/d9624a75d02ec5b274d4707d0c9c6e8c to your computer and use it in GitHub Desktop.
Configuring tasks for ms generator
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
const Generator = require('yeoman-generator'); | |
class MicroserviceGenerator extends Generator { | |
// ... other methods | |
configuring() { | |
// creating new variables | |
const { name } = this.options; | |
const title = `ms-${name.toLowerCase()}`; // will output as "ms-example" | |
// combining user data | |
this.answers = { | |
...this.config.getAll(), // getting saved config data | |
...this.answers, | |
name, | |
title, | |
}; | |
// saving to config file | |
this.config.set(this.answers); | |
} | |
} | |
module.exports = MicroserviceGenerator |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment