@@ -225,10 +225,11 @@ export class Config implements IConfig {
225
225
} )
226
226
}
227
227
228
- const successes = [ ]
229
- const failures = [ ]
230
-
231
- for ( const p of this . plugins ) {
228
+ const final = {
229
+ successes : [ ] ,
230
+ failures : [ ] ,
231
+ } as Hook . Result < Hooks [ T ] [ 'return' ] >
232
+ const promises = this . plugins . map ( async p => {
232
233
const debug = require ( 'debug' ) ( [ this . bin , p . name , 'hooks' , event ] . join ( ':' ) )
233
234
const context : Hook . Context = {
234
235
config : this ,
@@ -259,18 +260,21 @@ export class Config implements IConfig {
259
260
const result = timeout ?
260
261
await withTimeout ( timeout , search ( module ) . call ( context , { ...opts as any , config : this } ) ) :
261
262
await search ( module ) . call ( context , { ...opts as any , config : this } )
262
- successes . push ( { plugin : p , result} )
263
+ final . successes . push ( { plugin : p , result} )
263
264
264
265
debug ( 'done' )
265
266
} catch ( error ) {
266
- failures . push ( { plugin : p , error : error as Error } )
267
- if ( error && error . oclif && error . oclif . exit !== undefined ) throw error
267
+ final . failures . push ( { plugin : p , error : error as Error } )
268
+ debug ( error )
268
269
}
269
270
}
270
- }
271
+ } )
272
+
273
+ await Promise . all ( promises )
271
274
272
275
debug ( '%s hook done' , event )
273
- return { successes, failures}
276
+
277
+ return final
274
278
}
275
279
276
280
async runCommand < T = unknown > ( id : string , argv : string [ ] = [ ] , cachedCommand ?: Command . Plugin ) : Promise < T > {
0 commit comments