fix: ETXTBSY error on running setup (#8780)

close #8173
This commit is contained in:
Zoltan Kochan
2024-11-18 22:24:43 +01:00
committed by GitHub
parent 4f5c1714fa
commit c64d36c90e
4 changed files with 12 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
---
"@pnpm/plugin-commands-setup": patch
"pnpm": patch
---
`pnpm setup` should remove the CLI from the target location before moving the new binary [#8173](https://github.com/pnpm/pnpm/issues/8173).

View File

@@ -33,6 +33,7 @@
"@pnpm/cli-meta": "workspace:*",
"@pnpm/cli-utils": "workspace:*",
"@pnpm/os.env.path-extender": "catalog:",
"@zkochan/rimraf": "catalog:",
"render-help": "catalog:"
},
"funding": "https://opencollective.com/pnpm",

View File

@@ -9,6 +9,7 @@ import {
type PathExtenderReport,
} from '@pnpm/os.env.path-extender'
import renderHelp from 'render-help'
import rimraf from '@zkochan/rimraf'
export const rcOptionsTypes = (): Record<string, unknown> => ({})
@@ -59,6 +60,7 @@ function copyCli (currentLocation: string, targetDir: string): void {
prefix: process.cwd(),
})
fs.mkdirSync(targetDir, { recursive: true })
rimraf.sync(newExecPath)
fs.copyFileSync(currentLocation, newExecPath)
}

3
pnpm-lock.yaml generated
View File

@@ -3875,6 +3875,9 @@ importers:
'@pnpm/os.env.path-extender':
specifier: 'catalog:'
version: 2.0.0
'@zkochan/rimraf':
specifier: 'catalog:'
version: 3.0.2
render-help:
specifier: 'catalog:'
version: 1.0.3