mirror of
https://github.com/pnpm/pnpm.git
synced 2026-01-08 15:08:27 -05:00
fix: running executable pnpm CLI as a subprocess of pnpm CLI
This commit is contained in:
6
.changeset/five-dots-wave.md
Normal file
6
.changeset/five-dots-wave.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/exec.pnpm-cli-runner": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fix running pnpm CLI from pnpm CLI on Windows when the CLI is bundled to an executable.
|
||||
@@ -6,7 +6,8 @@ export function runPnpmCli (command: string[], { cwd }: { cwd: string }): void {
|
||||
cwd,
|
||||
stdio: 'inherit' as const,
|
||||
}
|
||||
if (path.basename(process.execPath) === 'pnpm') {
|
||||
const execFileName = path.basename(process.execPath).toLowerCase()
|
||||
if (execFileName === 'pnpm' || execFileName === 'pnpm.exe') {
|
||||
execSync(process.execPath, command, execOpts)
|
||||
} else if (path.basename(process.argv[1]) === 'pnpm.cjs') {
|
||||
execSync(process.execPath, [process.argv[1], ...command], execOpts)
|
||||
|
||||
Reference in New Issue
Block a user