refactor: self-update

This commit is contained in:
Zoltan Kochan
2025-11-19 22:28:58 +01:00
parent 98897ec421
commit c1ca7773cd
2 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/tools.plugin-commands-self-updater": patch
"pnpm": patch
---
`pnpm self-update` should download pnpm from the configure npm registry [#10205](https://github.com/pnpm/pnpm/pull/10205).

View File

@@ -57,9 +57,8 @@ export async function installPnpmToTools (pnpmVersion: string, opts: SelfUpdateC
// This is important when the user has configured a custom registry (e.g., a mirror)
// in their .npmrc file, as the temporary directory is outside the project and won't
// automatically pick up the project's .npmrc configuration.
const registry = opts.registries?.default || opts.rawConfig?.registry
if (registry) {
command.push(`--config.registry=${registry}`)
if (opts.registries?.default) {
command.push(`--config.registry=${opts.registries.default}`)
}
runPnpmCli(command, { cwd: stage })
// We need the operation of installing pnpm to be atomic.