Skip to content

Commit

Permalink
feat(cli): add flag to disable update notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnassri committed Sep 19, 2024
1 parent a324686 commit 7fcc410
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ If your OpenAPI description isn't everything you hoped it would be, enhance it w

This tool [collects data](./docs/usage-data.md) to help Redocly improve our products and services. You can opt out by setting the `REDOCLY_TELEMETRY` environment variable to `off`.

## Update notifications

Redocly CLI checks for updates on startup. You can disable this by setting the `REDOCLY_UPDATE_NOTIFIER` environment variable to `false`.

## More resources

[Read the detailed docs](https://redocly.com/docs/cli/).
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/utils/update-version-notifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const SPACE_TO_BORDER = 4;

const INTERVAL_TO_CHECK = 1000 * 60 * 60 * 12;
const SHOULD_NOT_NOTIFY =
process.env.NODE_ENV === 'test' || process.env.CI || !!process.env.LAMBDA_TASK_ROOT;
process.env.NODE_ENV === 'test' || process.env.CI || !!process.env.LAMBDA_TASK_ROOT || process.env.REDOCLY_UPDATE_NOTIFIER === 'false';

export const notifyUpdateCliVersion = () => {
if (SHOULD_NOT_NOTIFY) {
Expand Down

0 comments on commit 7fcc410

Please sign in to comment.