@@ -9,6 +9,7 @@ const initNoExtQuestions = [
99 { search : / ^ \? .+ / , response : '\n' } ,
1010] ;
1111
12+ /* eslint-disable max-len */
1213const commands = [
1314 { cmd : 'rm' , args : [ '-r' , 'test-project' ] , ignoreErrors : true } ,
1415 { cmd : './node_modules/.bin/vue' , args : [ 'init' , '.' , 'test-project' ] , responses : initQuestions } ,
@@ -25,6 +26,7 @@ const commands = [
2526 { cmd : 'npm' , args : [ 'run' , 'test:client' ] , cwd : 'test-project' } ,
2627 { cmd : 'npm' , args : [ 'run' , 'build' ] , cwd : 'test-project' } ,
2728] ;
29+ /* eslint-enable max-len */
2830
2931function executeCommand ( command , index ) {
3032 return new Promise ( ( resolve , reject ) => {
@@ -80,8 +82,12 @@ function executeCommand(command, index) {
8082 } ) ;
8183}
8284
83- commands . reduce ( ( prev , next , index ) => prev . then ( ( ) => executeCommand ( next , index )
84- . catch ( ( code ) => {
85- console . log ( 'child process exit with' , code ) ;
86- if ( ! next . ignoreErrors ) process . exit ( code ) ;
87- } ) ) , Promise . resolve ( ) ) ;
85+ commands . reduce (
86+ ( prev , next , index ) =>
87+ prev . then ( ( ) =>
88+ executeCommand ( next , index ) . catch ( ( code ) => {
89+ console . log ( 'child process exit with' , code ) ;
90+ if ( ! next . ignoreErrors ) process . exit ( code ) ;
91+ } ) ) ,
92+ Promise . resolve ( )
93+ ) ;
0 commit comments