fix: deduplicate plugins when cwd is the home directory#71
Merged
Conversation
When running from the home directory, project config and user config resolve to the same file, causing plugins to appear in both scopes. Add isUserConfigPath() to detect this overlap and skip project-level loading. Consolidate duplicated home-dir detection into a shared getHomeDir() in constants.ts (also fixes status.ts missing USERPROFILE). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
fa4d14e to
bc84aa4
Compare
When cwd resolves to the user config path (e.g., running from ~), install now correctly uses user scope instead of project scope, and uninstall skips the project-scope check to avoid double-removal errors. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
isUserConfigPath()to detect when project and user config resolve to the same file (i.e. cwd is the home directory), skipping project-level loading to avoid duplicatesprocess.env.HOME || process.env.USERPROFILE || '~'into a sharedgetHomeDir()inconstants.ts— also fixes a bug instatus.tswhereUSERPROFILEwas missingmarketplace-manifest-parser.test.ts(hardcoded Unix paths)Test plan
should not duplicate plugins when workspace is the home directorybun run src/cli/index.ts workspace statusfrom$HOMEshows plugins only under User Plugins🤖 Generated with Claude Code