mirror of
https://github.com/pnpm/action-setup.git
synced 2026-04-03 10:50:12 +08:00
fix: also create alias links in $PNPM_HOME/bin/
self-update links bins to $PNPM_HOME/bin/ which comes first in PATH. Without alias links there, the broken pnx shim from self-update (pointing to placeholder files) takes precedence over our .bin/pnx.
This commit is contained in:
240
dist/index.js
vendored
240
dist/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -62,8 +62,14 @@ export async function runSelfInstaller(inputs: Inputs): Promise<number> {
|
||||
}
|
||||
|
||||
// Create pn/pnx alias bin links if the installed version supports them
|
||||
// (pnpm v11+ adds pn and pnx as short aliases)
|
||||
// (pnpm v11+ adds pn and pnx as short aliases).
|
||||
// self-update links bins to $PNPM_HOME/bin/ which is also on PATH,
|
||||
// so we must create aliases in both directories.
|
||||
await ensureAliasLinks(pnpmHome, standalone)
|
||||
const pnpmBinDir = path.join(pnpmHome, 'bin')
|
||||
if (existsSync(pnpmBinDir)) {
|
||||
await ensureAliasLinks(pnpmBinDir, standalone)
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user