mirror of
https://github.com/pnpm/pnpm.git
synced 2026-02-09 22:52:12 -05:00
fix: dir path repeated join in link global (#5434)
This commit is contained in:
5
.changeset/rotten-moose-search.md
Normal file
5
.changeset/rotten-moose-search.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@pnpm/plugin-commands-installation": patch
|
||||
---
|
||||
|
||||
fix dir path repeated join in link global
|
||||
@@ -116,7 +116,7 @@ export async function handler (
|
||||
const { manifest, writeProjectManifest } = await tryReadProjectManifest(opts.dir, opts)
|
||||
const newManifest = await addDependenciesToPackage(
|
||||
manifest ?? {},
|
||||
[`link:${opts.cliOptions?.dir ? path.join(cwd, opts.cliOptions.dir) : cwd}`],
|
||||
[`link:${opts.cliOptions?.dir ? path.resolve(opts.cliOptions.dir) : cwd}`],
|
||||
linkOpts
|
||||
)
|
||||
await writeProjectManifest(newManifest)
|
||||
|
||||
@@ -88,7 +88,7 @@ test('link --dir global bin', async function () {
|
||||
await link.handler({
|
||||
...DEFAULT_OPTS,
|
||||
cliOptions: {
|
||||
dir: './dir/package-with-bin-in-dir',
|
||||
dir: path.resolve('./dir/package-with-bin-in-dir'),
|
||||
},
|
||||
bin: globalBin,
|
||||
dir: globalDir,
|
||||
|
||||
Reference in New Issue
Block a user