@@ -6,7 +6,6 @@ var SG = require('strong-globalize');
66SG . SetRootDir ( path . resolve ( __dirname , '..' ) ) ;
77var g = SG ( ) ;
88var fs = require ( 'fs' ) ;
9- var Promise = require ( 'bluebird' ) ;
109var semver = require ( 'semver' ) ;
1110var optimist = require ( 'optimist' ) ;
1211var generator = require ( 'loopback-sdk-angular' ) ;
@@ -60,17 +59,9 @@ function runGenerator() {
6059 process . stdout . write ( result ) ;
6160 }
6261
63- // The app.js scaffolded by `slc lb project` loads strong-agent module that
64- // used to have a bug where it prevented the application from exiting.
65- // To work around that issue, we are explicitly exiting here.
66- //
67- // The exit is deferred to both stdout and err is drained
68- // in order to prevent the Node bug:
62+ // The exit is deferred to the next tick in order to prevent the Node bug:
6963 // https://github.com/joyent/node/issues/3584
70- Promise . all ( [
71- waitForEvent ( process . stdout , 'drain' ) ,
72- waitForEvent ( process . stderr , 'drain' ) ,
73- ] ) . then ( function ( ) {
64+ process . nextTick ( function ( ) {
7465 process . exit ( ) ;
7566 } ) ;
7667}
@@ -92,10 +83,3 @@ function assertLoopBackVersion() {
9283 process . exit ( 1 ) ;
9384 }
9485}
95-
96- function waitForEvent ( obj , name ) {
97- return new Promise ( function ( resolve , reject ) {
98- obj . once ( name , resolve ) ;
99- obj . once ( 'error' , reject ) ;
100- } ) ;
101- }
0 commit comments