mirror of
https://github.com/pnpm/pnpm.git
synced 2026-04-27 18:46:18 -04:00
fix: show absolute path instead of ??? when globally linking from cwd (#10899)
When running `pnpm add -g .`, the linked-from path equals the cwd, so path.relative() returns an empty string which is falsy, causing the fallback to '???'. Use the absolute path as fallback instead. Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
6
.changeset/fix-global-link-output.md
Normal file
6
.changeset/fix-global-link-output.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"@pnpm/default-reporter": patch
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Fixed global install output showing `???` instead of the linked package path when linking from the current directory.
|
||||
@@ -118,7 +118,7 @@ function printDiffs (
|
||||
result += ` ${chalk.red('deprecated')}`
|
||||
}
|
||||
if (pkg.from) {
|
||||
result += ` ${chalk.grey(`<- ${pkg.from && path.relative(opts.prefix, pkg.from) || '???'}`)}`
|
||||
result += ` ${chalk.grey(`<- ${path.relative(opts.prefix, pkg.from) || pkg.from}`)}`
|
||||
}
|
||||
if (pkg.added && depType === 'dev' && opts.pnpmConfig?.saveDev === false && opts.cmd === 'add') {
|
||||
result += `${chalk.yellow(' already in devDependencies, was not moved to dependencies.')}`
|
||||
|
||||
Reference in New Issue
Block a user