* Runs given hooks sequentially by mapping them to promises and iterating * through while awaiting
(hooks: HookFunction[])
| 85 | * through while awaiting |
| 86 | */ |
| 87 | function sequentialHooks(hooks: HookFunction[]): PromisifiedHookFunction[] { |
| 88 | return [ |
| 89 | hidePromiseFromPromisify( |
| 90 | async ( |
| 91 | buildPath: string, |
| 92 | electronVersion: string, |
| 93 | platform: string, |
| 94 | arch: string, |
| 95 | done: DoneFunction, |
| 96 | ) => { |
| 97 | for (const hook of hooks) { |
| 98 | try { |
| 99 | await promisify(hook)(buildPath, electronVersion, platform, arch); |
| 100 | } catch (err) { |
| 101 | d('hook failed:', hook.toString(), err); |
| 102 | return done(err as Error); |
| 103 | } |
| 104 | } |
| 105 | done(); |
| 106 | }, |
| 107 | ), |
| 108 | ] as PromisifiedHookFunction[]; |
| 109 | } |
| 110 | function sequentialFinalizePackageTargetsHooks( |
| 111 | hooks: FinalizePackageTargetsHookFunction[], |
| 112 | ): PromisifiedFinalizePackageTargetsHookFunction[] { |
no test coverage detected