MCPcopy
hub / github.com/electron/forge / triggerHook

Method triggerHook

packages/api/core/src/util/plugin-interface.ts:95–112  ·  view source on GitHub ↗
(
    hookName: Hook,
    hookArgs: ForgeSimpleHookSignatures[Hook],
  )

Source from the content-addressed store, hash-verified

93 }
94
95 async triggerHook<Hook extends keyof ForgeSimpleHookSignatures>(
96 hookName: Hook,
97 hookArgs: ForgeSimpleHookSignatures[Hook],
98 ): Promise<void> {
99 for (const plugin of this.plugins) {
100 if (typeof plugin.getHooks === 'function') {
101 let hooks = plugin.getHooks()[hookName] as
102 | ForgeSimpleHookFn<Hook>[]
103 | ForgeSimpleHookFn<Hook>;
104 if (hooks) {
105 if (typeof hooks === 'function') hooks = [hooks];
106 for (const hook of hooks) {
107 await hook(this.config, ...hookArgs);
108 }
109 }
110 }
111 }
112 }
113
114 async getHookListrTasks<Hook extends keyof ForgeSimpleHookSignatures>(
115 childTrace: typeof autoTrace,

Callers

nothing calls this directly

Calls 1

getHooksMethod · 0.65

Tested by

no test coverage detected