mirror of
https://github.com/pnpm/action-setup.git
synced 2026-03-16 23:36:11 +08:00
fix: run bootstrap pnpm via node instead of bin shim
Use `node .../pnpm/bin/pnpm.cjs` to run the bootstrap pnpm, matching the approach used by the old bundled pnpm.cjs. This avoids issues with the .bin symlink on different platforms. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -27,7 +27,7 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
|||||||
return npmExitCode
|
return npmExitCode
|
||||||
}
|
}
|
||||||
|
|
||||||
const bootstrapPnpm = path.join(bootstrapDir, 'node_modules', '.bin', 'pnpm')
|
const bootstrapPnpm = path.join(bootstrapDir, 'node_modules', 'pnpm', 'bin', 'pnpm.cjs')
|
||||||
|
|
||||||
// Step 2: Use bootstrap pnpm to install the target version (verified via project's pnpm-lock.yaml)
|
// Step 2: Use bootstrap pnpm to install the target version (verified via project's pnpm-lock.yaml)
|
||||||
await rm(dest, { recursive: true, force: true })
|
await rm(dest, { recursive: true, force: true })
|
||||||
@@ -47,8 +47,8 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
|||||||
|
|
||||||
// prepare target pnpm
|
// prepare target pnpm
|
||||||
const target = await readTarget({ version, packageJsonFile, standalone })
|
const target = await readTarget({ version, packageJsonFile, standalone })
|
||||||
const installArgs = ['install', target, '--no-lockfile']
|
const installArgs = [bootstrapPnpm, 'install', target, '--no-lockfile']
|
||||||
const exitCode = await runCommand(bootstrapPnpm, installArgs, { cwd: dest })
|
const exitCode = await runCommand(process.execPath, installArgs, { cwd: dest })
|
||||||
if (exitCode === 0) {
|
if (exitCode === 0) {
|
||||||
const pnpmHome = path.join(dest, 'node_modules/.bin')
|
const pnpmHome = path.join(dest, 'node_modules/.bin')
|
||||||
addPath(pnpmHome)
|
addPath(pnpmHome)
|
||||||
|
|||||||
Reference in New Issue
Block a user