fix: dir path repeated join in link global (#5434)

This commit is contained in:
chlorine authored and GitHub committed 2022-10-01 15:10:48 +03:00
1 parent 2e830c0cb7
commit 5beb4e26b8
3 files changed
+7 -2

No files matched your search

+5
View 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,