@@ -63,16 +63,15 @@ export class Generator extends Base {
6363 this . log ( 'Out of the box I create an AngularJS app with an Express server.\n' ) ;
6464 } ,
6565 checkForConfig : function ( ) {
66- var cb = this . async ( ) ;
6766 var existingFilters = this . config . get ( 'filters' ) ;
6867
6968 if ( existingFilters ) {
70- this . prompt ( [ {
69+ return this . prompt ( [ {
7170 type : 'confirm' ,
7271 name : 'skipConfig' ,
7372 message : 'Existing .yo-rc configuration found, would you like to use it?' ,
7473 default : true ,
75- } ] , answers => {
74+ } ] ) . then ( answers => {
7675 this . skipConfig = answers . skipConfig ;
7776
7877 if ( this . skipConfig ) {
@@ -92,11 +91,7 @@ export class Generator extends Base {
9291 this . config . set ( 'filters' , this . filters ) ;
9392 this . config . forceSave ( ) ;
9493 }
95-
96- cb ( ) ;
9794 } ) ;
98- } else {
99- cb ( ) ;
10095 }
10196 }
10297 } ;
@@ -106,11 +101,10 @@ export class Generator extends Base {
106101 return {
107102 clientPrompts : function ( ) {
108103 if ( this . skipConfig ) return ;
109- var cb = this . async ( ) ;
110104
111105 this . log ( '# Client\n' ) ;
112106
113- this . prompt ( [ {
107+ return this . prompt ( [ {
114108 type : 'list' ,
115109 name : 'transpiler' ,
116110 message : 'What would you like to write scripts with?' ,
@@ -156,7 +150,7 @@ export class Generator extends Base {
156150 name : 'uibootstrap' ,
157151 message : 'Would you like to include UI Bootstrap?' ,
158152 when : answers => answers . bootstrap
159- } ] , answers => {
153+ } ] ) . then ( answers => {
160154 this . filters . js = true ;
161155 this . filters [ answers . transpiler ] = true ;
162156 insight . track ( 'transpiler' , answers . transpiler ) ;
@@ -184,18 +178,15 @@ export class Generator extends Base {
184178
185179 var styleExt = { sass : 'scss' , stylus : 'styl' } [ answers . stylesheet ] ;
186180 this . styleExt = styleExt ? styleExt : answers . stylesheet ;
187-
188- cb ( ) ;
189181 } ) ;
190182 } ,
191183 serverPrompts : function ( ) {
192184 if ( this . skipConfig ) return ;
193- var cb = this . async ( ) ;
194185 var self = this ;
195186
196187 this . log ( '\n# Server\n' ) ;
197188
198- this . prompt ( [ {
189+ return this . prompt ( [ {
199190 type : 'checkbox' ,
200191 name : 'odms' ,
201192 message : 'What would you like to use for data modeling?' ,
@@ -245,7 +236,7 @@ export class Generator extends Base {
245236 // to-do: should not be dependent on ODMs
246237 when : answers => answers . odms && answers . odms . length !== 0 ,
247238 default : true
248- } ] , answers => {
239+ } ] ) . then ( answers => {
249240 if ( answers . socketio ) this . filters . socketio = true ;
250241 insight . track ( 'socketio' , ! ! answers . socketio ) ;
251242
@@ -284,18 +275,15 @@ export class Generator extends Base {
284275 insight . track ( 'google-oauth' , ! ! this . filters [ 'googleAuth' ] ) ;
285276 insight . track ( 'facebook-oauth' , ! ! this . filters [ 'facebookAuth' ] ) ;
286277 insight . track ( 'twitter-oauth' , ! ! this . filters [ 'twitterAuth' ] ) ;
287-
288- cb ( ) ;
289278 } ) ;
290279 } ,
291280 projectPrompts : function ( ) {
292281 if ( this . skipConfig ) return ;
293- var cb = this . async ( ) ;
294282 var self = this ;
295283
296284 this . log ( '\n# Project\n' ) ;
297285
298- this . prompt ( [ {
286+ return this . prompt ( [ {
299287 type : 'list' ,
300288 name : 'buildtool' ,
301289 message : 'Would you like to use Gulp or Grunt?' ,
@@ -320,7 +308,7 @@ export class Generator extends Base {
320308 choices : [ 'Expect' , 'Should' ] ,
321309 filter : val => val . toLowerCase ( ) ,
322310 when : answers => answers . testing === 'mocha'
323- } ] , answers => {
311+ } ] ) . then ( answers => {
324312 this . filters [ answers . buildtool ] = true ;
325313 insight . track ( 'buildtool' , answers . buildtool ) ;
326314
@@ -338,8 +326,6 @@ export class Generator extends Base {
338326 this . filters . should = false ;
339327 this . filters . expect = false ;
340328 }
341-
342- cb ( ) ;
343329 } ) ;
344330 }
345331 } ;
0 commit comments