-
-
Notifications
You must be signed in to change notification settings - Fork 936
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
packages/pnpm/src/checkForUpdates.ts
Outdated
@@ -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) { |
There was a problem hiding this comment.
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:
pnpm/packages/pnpm/src/main.ts
Lines 228 to 237 in 4e778cf
if ( | |
!isCI && | |
!selfUpdate && | |
!config.offline && | |
!config.preferOffline && | |
!config.fallbackCommandUsed && | |
(cmd === 'install' || cmd === 'add') | |
) { | |
checkForUpdates(config).catch(() => { /* Ignore */ }) | |
} |
There was a problem hiding this comment.
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.
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.
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. Theupdate-notifier
option exists in NPM so it can also ease the migration to pnpm.Closes #4158.