Skip to content

Commit 35a0670

Browse files
committed
fix(@angular/cli): eliminate prompts during ng version command
This update removes the analytics and completion prompts that appear when executing the `ng version` command, ensuring a smoother and uninterrupted user experience. Closes #27668
1 parent 0a69322 commit 35a0670

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/angular/cli/src/command-builder/command-module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ export abstract class CommandModule<T extends {} = {}> implements CommandModuleI
176176

177177
const userId = await getAnalyticsUserId(
178178
this.context,
179-
// Don't prompt for `ng update` and `ng analytics` commands.
180-
['update', 'analytics'].includes(this.commandName),
179+
// Don't prompt on `ng update`, 'ng version' or `ng analytics`.
180+
['version', 'update', 'analytics'].includes(this.commandName),
181181
);
182182

183183
return userId ? new AnalyticsCollector(this.context, userId) : undefined;

packages/angular/cli/src/utilities/completion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ async function shouldPromptForAutocompletionSetup(
130130
return forceAutocomplete;
131131
}
132132

133-
// Don't prompt on `ng update` or `ng completion`.
134-
if (command === 'update' || command === 'completion') {
133+
// Don't prompt on `ng update`, 'ng version' or `ng completion`.
134+
if (['version', 'update', 'completion'].includes(command)) {
135135
return false;
136136
}
137137

0 commit comments

Comments
 (0)