Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output where preference is saved #31305

Merged
merged 2 commits into from Nov 11, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions packages/next/cli/next-telemetry.ts
Expand Up @@ -53,9 +53,13 @@ const nextTelemetry: cliCommand = (argv) => {

isEnabled = true
} else if (args['--disable'] || args._[0] === 'disable') {
telemetry.setEnabled(false)
const path = telemetry.setEnabled(false)
if (isEnabled) {
console.log(chalk.cyan('Your preference has been saved.'))
console.log(
chalk.cyan(
`Your preference has been saved${path ? ` to ${path}` : ''}.`
)
)
} else {
console.log(
chalk.yellow(`Next.js' telemetry collection is already disabled.`)
Expand Down
1 change: 1 addition & 0 deletions packages/next/telemetry/storage.ts
Expand Up @@ -138,6 +138,7 @@ export class Telemetry {
setEnabled = (_enabled: boolean) => {
const enabled = !!_enabled
this.conf && this.conf.set(TELEMETRY_KEY_ENABLED, enabled)
return this.conf && this.conf.path
}

get isEnabled(): boolean {
Expand Down