mirror of
https://github.com/pnpm/pnpm.git
synced 2025-12-24 07:38:12 -05:00
feat: add support of the update-notifier configuration option (#4285)
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). close #4158. Co-authored-by: Zoltan Kochan <z@kochan.io>
This commit is contained in:
6
.changeset/forty-pens-stare.md
Normal file
6
.changeset/forty-pens-stare.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/config": minor
|
||||
"pnpm": minor
|
||||
---
|
||||
|
||||
Add support of the `update-notifier` configuration option [#4158](https://github.com/pnpm/pnpm/issues/4158).
|
||||
@@ -92,6 +92,7 @@ export interface Config {
|
||||
|
||||
userAgent?: string
|
||||
tag?: string
|
||||
updateNotifier?: boolean
|
||||
|
||||
alwaysAuth?: boolean
|
||||
|
||||
|
||||
@@ -121,6 +121,7 @@ export const types = Object.assign({
|
||||
'test-pattern': [String, Array],
|
||||
'changed-files-ignore-pattern': [String, Array],
|
||||
'embed-readme': Boolean,
|
||||
'update-notifier': Boolean,
|
||||
}, npmTypes.types)
|
||||
|
||||
export type CliOptions = Record<string, unknown> & { dir?: string }
|
||||
|
||||
@@ -226,6 +226,7 @@ export default async function run (inputArgv: string[]) {
|
||||
await new Promise<void>((resolve) => setTimeout(() => resolve(), 0))
|
||||
|
||||
if (
|
||||
config.updateNotifier !== false &&
|
||||
!isCI &&
|
||||
!selfUpdate &&
|
||||
!config.offline &&
|
||||
|
||||
Reference in New Issue
Block a user