From 8c4d4139cee10e333f240fe8d11140b31340b90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leosvel=20P=C3=A9rez=20Espinosa?= Date: Thu, 9 Jun 2022 11:46:41 +0100 Subject: [PATCH] fix(core): prevent "ng completion" command to run through the nx cli --- packages/nx/bin/init-local.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/packages/nx/bin/init-local.ts b/packages/nx/bin/init-local.ts index 337e833fe0c5f..8c5cf0722bdd2 100644 --- a/packages/nx/bin/init-local.ts +++ b/packages/nx/bin/init-local.ts @@ -80,7 +80,15 @@ function isKnownCommand() { function shouldDelegateToAngularCLI() { const command = process.argv[2]; - const commands = ['add', 'analytics', 'deploy', 'config', 'doc', 'update']; + const commands = [ + 'add', + 'analytics', + 'deploy', + 'config', + 'doc', + 'update', + 'completion', + ]; return commands.indexOf(command) > -1; } @@ -130,6 +138,10 @@ function handleAngularCLIFallbacks(workspace: WorkspaceTypeAndRoot) { } }) ); + } else if (process.argv[2] === 'completion') { + console.log(`"ng completion" is not natively supported by Nx. +Instead, you could try an Nx Editor Plugin for a visual tool to run Nx commands. If you're using VSCode, you can use the Nx Console plugin, or if you're using WebStorm, you could use one of the available community plugins. +For more information, see https://nx.dev/using-nx/console`); } else { require('nx/src/adapter/compat'); try {