11import { Inject , Injectable } from '@nestjs/common' ;
22import { flatten , isString , kebabCase , sortBy , upperFirst } from 'lodash' ;
33
4- import concurrently from 'concurrently' ;
4+ import concurrently , { type CloseEvent } from 'concurrently' ;
55import * as path from 'path' ;
66import * as fs from 'fs-extra' ;
77import * as glob from 'glob' ;
@@ -94,7 +94,9 @@ export class GeneratorService {
9494 commands . length > 0 &&
9595 ( await ( async ( ) => {
9696 try {
97- this . printResult ( await concurrently ( commands , { maxProcesses : 10 } ) ) ;
97+ this . printResult (
98+ await concurrently ( commands , { maxProcesses : 10 } ) . result ,
99+ ) ;
98100 return true ;
99101 } catch ( e ) {
100102 this . printResult ( e ) ;
@@ -110,13 +112,11 @@ export class GeneratorService {
110112 return generated ;
111113 }
112114
113- private printResult (
114- res : { command : concurrently . CommandObj ; exitCode : number } [ ]
115- ) {
115+ private printResult ( res : CloseEvent [ ] ) {
116116 this . logger . log (
117117 sortBy ( res , 'command.name' )
118118 . map ( ( { exitCode, command } ) => {
119- const failed = exitCode > 0 ;
119+ const failed = typeof exitCode === 'string' || exitCode > 0 ;
120120 return [
121121 chalk [ failed ? 'red' : 'green' ] ( command . name ) ,
122122 ...( failed ? [ chalk . yellow ( ` ${ command . command } \n` ) ] : [ ] ) ,
0 commit comments