Skip to content

Commit

Permalink
Output where preference is saved (#31305)
Browse files Browse the repository at this point in the history
Fixes #31241



## Bug

- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

## Feature

- [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
- [ ] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Documentation added
- [ ] Telemetry added. In case of a feature if it's used or not.
- [ ] Errors have helpful link attached, see `contributing.md`

## Documentation / Examples

- [ ] Make sure the linting passes by running `yarn lint`
  • Loading branch information
timneutkens committed Nov 11, 2021
1 parent fbe366f commit c4558c9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
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

0 comments on commit c4558c9

Please sign in to comment.