File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed
Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change 11'use strict' ;
2- var Generator = require ( 'yeoman-generator' ) ;
3- var chalk = require ( 'chalk' ) ;
4- var yosay = require ( 'yosay' ) ;
2+ const Generator = require ( 'yeoman-generator' ) ;
3+ const chalk = require ( 'chalk' ) ;
4+ const yosay = require ( 'yosay' ) ;
55
6- module . exports = Generator . extend ( {
7- prompting : function ( ) {
6+ module . exports = class extends Generator {
7+ prompting ( ) {
88 // Have Yeoman greet the user.
99 this . log ( yosay (
1010 'Welcome to the <%- superb %> ' + chalk . red ( '<%= generatorName %>' ) + ' generator!'
1111 ) ) ;
1212
13- var prompts = [ {
13+ const prompts = [ {
1414 type : 'confirm' ,
1515 name : 'someAnswer' ,
1616 message : 'Would you like to enable this option?' ,
1717 default : true
1818 } ] ;
1919
20- return this . prompt ( prompts ) . then ( function ( props ) {
20+ return this . prompt ( prompts ) . then ( props => {
2121 // To access props later use this.props.someAnswer;
2222 this . props = props ;
23- } . bind ( this ) ) ;
24- } ,
23+ } ) ;
24+ }
2525
26- writing : function ( ) {
26+ writing ( ) {
2727 this . fs . copy (
2828 this . templatePath ( 'dummyfile.txt' ) ,
2929 this . destinationPath ( 'dummyfile.txt' )
3030 ) ;
31- } ,
31+ }
3232
33- install : function ( ) {
33+ install ( ) {
3434 this . installDependencies ( ) ;
3535 }
36- } ) ;
36+ } ;
You can’t perform that action at this time.
0 commit comments