Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: dir path repeated join in link global #5434

Merged
merged 2 commits into from Oct 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-moose-search.md
@@ -0,0 +1,5 @@
---
"@pnpm/plugin-commands-installation": patch
---

fix dir path repeated join in link global
2 changes: 1 addition & 1 deletion packages/plugin-commands-installation/src/link.ts
Expand Up @@ -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(cwd, opts.cliOptions.dir) : cwd}`],
lvqq marked this conversation as resolved.
Show resolved Hide resolved
linkOpts
)
await writeProjectManifest(newManifest)
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-commands-installation/test/link.ts
Expand Up @@ -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(process.cwd(), './dir/package-with-bin-in-dir'),
lvqq marked this conversation as resolved.
Show resolved Hide resolved
},
bin: globalBin,
dir: globalDir,
Expand Down