MCPcopy Index your code
hub / github.com/electron/forge / sequentialHooks

Function sequentialHooks

packages/api/core/src/api/package.ts:87–109  ·  view source on GitHub ↗

* Runs given hooks sequentially by mapping them to promises and iterating * through while awaiting

(hooks: HookFunction[])

Source from the content-addressed store, hash-verified

85 * through while awaiting
86 */
87function 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}
110function sequentialFinalizePackageTargetsHooks(
111 hooks: FinalizePackageTargetsHookFunction[],
112): PromisifiedFinalizePackageTargetsHookFunction[] {

Callers 1

listrPackageFunction · 0.85

Calls 1

hidePromiseFromPromisifyFunction · 0.85

Tested by

no test coverage detected