From 7fe6d6fa928ec7ac734067bb66c1807428b87598 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 26 Jun 2019 09:03:36 +0300 Subject: [PATCH 1/2] fix: fix the execution of hooks when there is unresolved injected dependency Rel to: https://github.com/NativeScript/nativescript-cli/issues/4770 --- lib/common/services/hooks-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/services/hooks-service.ts b/lib/common/services/hooks-service.ts index 8822da5d3a..025f41f5d3 100644 --- a/lib/common/services/hooks-service.ts +++ b/lib/common/services/hooks-service.ts @@ -121,7 +121,7 @@ export class HooksService implements IHooksService { if (invalidArguments.length) { this.$logger.warn(`${hookName} will NOT be executed because it has invalid arguments - ${invalidArguments.join(", ").grey}.`); - return; + continue; } // HACK for backwards compatibility: From a2b13c930f341a2ab018cf78b823ea5a30600280 Mon Sep 17 00:00:00 2001 From: fatme Date: Wed, 26 Jun 2019 09:46:21 +0300 Subject: [PATCH 2/2] fix: show the full path to the hook in warning message --- lib/common/services/hooks-service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/common/services/hooks-service.ts b/lib/common/services/hooks-service.ts index 025f41f5d3..1362aa9a64 100644 --- a/lib/common/services/hooks-service.ts +++ b/lib/common/services/hooks-service.ts @@ -120,7 +120,7 @@ export class HooksService implements IHooksService { const invalidArguments = this.validateHookArguments(hookEntryPoint); if (invalidArguments.length) { - this.$logger.warn(`${hookName} will NOT be executed because it has invalid arguments - ${invalidArguments.join(", ").grey}.`); + this.$logger.warn(`${hook.fullPath} will NOT be executed because it has invalid arguments - ${invalidArguments.join(", ").grey}.`); continue; }