From 7a135df7684c79b35b385836657852c2d10e8f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Thu, 18 Jul 2024 17:18:58 +0200 Subject: [PATCH] refactor(core): Delete dead code in ExternalHooks (no-changelog) (#10100) --- packages/cli/src/ExternalHooks.ts | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index a91caee4c9..2cdbd441d7 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -42,17 +42,7 @@ export class ExternalHooks { this.initDidRun = true; } - async reload(externalHooks?: IExternalHooksFileData) { - this.externalHooks = {}; - - if (externalHooks === undefined) { - await this.loadHooksFiles(true); - } else { - this.loadHooks(externalHooks); - } - } - - async loadHooksFiles(reload = false) { + private async loadHooksFiles() { const externalHookFiles = config.getEnv('externalHookFiles').split(':'); // Load all the provided hook-files @@ -60,10 +50,6 @@ export class ExternalHooks { hookFilePath = hookFilePath.trim(); if (hookFilePath !== '') { try { - if (reload) { - delete require.cache[require.resolve(hookFilePath)]; - } - const hookFile = require(hookFilePath) as IExternalHooksFileData; this.loadHooks(hookFile); } catch (e) { @@ -78,7 +64,7 @@ export class ExternalHooks { } } - loadHooks(hookFileData: IExternalHooksFileData) { + private loadHooks(hookFileData: IExternalHooksFileData) { for (const resource of Object.keys(hookFileData)) { for (const operation of Object.keys(hookFileData[resource])) { // Save all the hook functions directly under their string