From 91b5bcbb31715a3c2e183e264ebd5ec1188d5437 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Tue, 25 Oct 2022 12:34:04 +0000 Subject: [PATCH] fix(@angular/cli): disable version check during auto completion This causes sub broken DX ``` ng bui[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used. To disable this warning use "ng config -g cli.warnings.versionMismatch false". ld --conf[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used. To disable this warning use "ng config -g cli.warnings.versionMismatch false". iguration dev[TAB]Your global Angular CLI version (14.2.6) is greater than your local version (14.1.3). The local Angular CLI version is used. To disable this warning use "ng config -g cli.warnings.versionMismatch false". elopment ``` Closes #24133 (cherry picked from commit ca7ca1bdfd55842ec87b61b063f5cadb1c91005d) --- packages/angular/cli/lib/init.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/angular/cli/lib/init.ts b/packages/angular/cli/lib/init.ts index ce4014a4db80..0fe6db643f9a 100644 --- a/packages/angular/cli/lib/init.ts +++ b/packages/angular/cli/lib/init.ts @@ -86,7 +86,11 @@ let forceExit = false; } // When using the completion command, don't show the warning as otherwise this will break completion. - if (isGlobalGreater && rawCommandName !== 'completion') { + if ( + isGlobalGreater && + rawCommandName !== '--get-yargs-completions' && + rawCommandName !== 'completion' + ) { // If using the update command and the global version is greater, use the newer update command // This allows improvements in update to be used in older versions that do not have bootstrapping if (