File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,22 @@ const startSampleAndRun = async () => {
155155 } )
156156 . catch ( ( exitInfos ) => {
157157 // Concurrently throws SIGTERM with exit code 0 on success, check code and exit with it
158- const { exitCode } = exitInfos [ 0 ] ;
159- process . exit ( exitCode ) ;
158+ if ( Array . isArray ( exitInfos ) ) {
159+ // If it's an array of exit infos
160+ const exitInfo = exitInfos [ 0 ] ;
161+ if ( exitInfo ?. signal === 'SIGTERM' ) {
162+ process . exit ( 0 ) ;
163+ }
164+ const exitCode = exitInfo ?. exitCode ?? 1 ;
165+ process . exit ( exitCode ) ;
166+ } else {
167+ // If it's a single error object
168+ if ( exitInfos ?. signal === 'SIGTERM' ) {
169+ process . exit ( 0 ) ;
170+ }
171+ const exitCode = exitInfos ?. exitCode ?? 1 ;
172+ process . exit ( exitCode ) ;
173+ }
160174 } ) ;
161175} ;
162176
You can’t perform that action at this time.
0 commit comments