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

feat: add support of the update-notifier configuration option #4285

Merged
merged 2 commits into from
Jan 27, 2022
Merged

feat: add support of the update-notifier configuration option #4285

merged 2 commits into from
Jan 27, 2022

Conversation

LeSuisse
Copy link
Contributor

The configuration option update-notifier allows users to disable the update verification. This is interesting when pnpm is installed from another package manager because the given instructions will not be accurate. The update-notifier option exists in NPM so it can also ease the migration to pnpm.

Closes #4158.

Copy link
Member

@zkochan zkochan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -14,6 +14,9 @@ interface State {
const UPDATE_CHECK_FREQUENCY = 24 * 60 * 60 * 1000 // 1 day

export default async function (config: Config) {
if (!config.updateNotifier) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just don't run this function in this case. There are already lots of conditions in main.ts:

if (
!isCI &&
!selfUpdate &&
!config.offline &&
!config.preferOffline &&
!config.fallbackCommandUsed &&
(cmd === 'install' || cmd === 'add')
) {
checkForUpdates(config).catch(() => { /* Ignore */ })
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep I saw that but I was a bit unsure on how to cover it with a test here.

packages/config/src/Config.ts Outdated Show resolved Hide resolved
LeSuisse and others added 2 commits January 27, 2022 20:45
The configuration option `update-notifier` allows users to disable the
update verification. This is interesting when pnpm is installed from
another package manager because the given instructions will not be
accurate. The `update-notifier` option exists in NPM so it can also
ease the migration to pnpm.
(https://docs.npmjs.com/cli/v8/using-npm/config#update-notifier).

Closes #4158.
@zkochan zkochan merged commit 334e534 into pnpm:main Jan 27, 2022
@zkochan zkochan added this to the v6.29 milestone Jan 27, 2022
@gluxon
Copy link
Member

gluxon commented Jan 27, 2022

Thanks @LeSuisse and @zkochan

@LeSuisse LeSuisse deleted the support-update-notifier-config branch January 28, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config option to disable update check notification
3 participants