| 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, |