11const Generator = require ( 'yeoman-generator' ) ;
2- const chalk = require ( "chalk" ) ;
3- const yosay = require ( "yosay" ) ;
2+ const chalk = require ( 'chalk' ) ;
3+ const yosay = require ( 'yosay' ) ;
4+
45const pkg = require ( '../../package.json' ) ;
56
67module . exports = class extends Generator {
78 async prompting ( ) {
89 this . log (
9- yosay (
10- `Welcome to the astounding ${ chalk . red ( pkg . name ) } generator!`
11- )
10+ yosay ( `Welcome to the astounding ${ chalk . red ( pkg . name ) } generator!` ) ,
1211 ) ;
13-
12+
1413 const prompts = [
1514 {
16- type : " input" ,
17- name : " elementName" ,
18- message : " What is the name of your service?" ,
19- default : " my-awesome-service"
15+ type : ' input' ,
16+ name : ' elementName' ,
17+ message : ' What is the name of your service?' ,
18+ default : ' my-awesome-service' ,
2019 } ,
2120 {
22- type : " input" ,
23- name : " elementDescription" ,
24- message : " Give us some small description of your service" ,
25- default : ""
21+ type : ' input' ,
22+ name : ' elementDescription' ,
23+ message : ' Give us some small description of your service' ,
24+ default : '' ,
2625 } ,
2726 {
28- type : " input" ,
29- name : " elementAuthor" ,
30- message : " Who is the author of this service?" ,
31- default : ""
27+ type : ' input' ,
28+ name : ' elementAuthor' ,
29+ message : ' Who is the author of this service?' ,
30+ default : '' ,
3231 } ,
3332 ] ;
3433
@@ -40,20 +39,18 @@ module.exports = class extends Generator {
4039
4140 writing ( ) {
4241 this . fs . copyTpl (
43- [
44- this . templatePath ( '**' ) ,
45- ] ,
42+ [ this . templatePath ( '**' ) ] ,
4643 this . destinationPath ( ) ,
4744 this . props ,
4845 ) ;
4946
5047 this . fs . copyTpl (
5148 this . templatePath ( '.env.example' ) ,
52- this . destinationPath ( '.env.example' )
49+ this . destinationPath ( '.env.example' ) ,
5350 ) ;
5451 }
5552
56- install ( ) {
53+ install ( ) {
5754 this . installDependencies ( ) ;
5855 }
5956} ;
0 commit comments