Skip to content

Commit a49cdfb

Browse files
alan-agius4clydin
authored andcommitted
fix(@angular/cli): don't prompt for analytics when running ng analytics
This addresses the issue when trying to disable analytics the prompt will be shown ``` ng analytics off Would you like to share anonymous usage data about this project with the Angular Team at Google under Google’s Privacy Policy at https://policies.google.com/privacy? For more details and how to change this setting, see http://angular.io/analytics. (y/N) ``` Closes #16784 (cherry picked from commit 9a9bd3f2ac22211dc6e8a47be582c5e1390189d7)
1 parent e873cd1 commit a49cdfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ export abstract class CommandModule<T extends {} = {}> implements CommandModuleI
173173

174174
return (this._analytics = await createAnalytics(
175175
!!this.context.workspace,
176-
this.commandName === 'update',
176+
// Don't prompt for `ng update` and `ng analytics` commands.
177+
['update', 'analytics'].includes(this.commandName),
177178
));
178179
}
179180

0 commit comments

Comments
 (0)