[fix] Correct dirPlugins() default paths to match specification.md - #94
Merged
Conversation
dirPlugins() returned bare relative paths that didn't match the spec's directory table: - Linux: spec says $HOME/usr/local/lib, code returned relative "usr/local/lib" with no $HOME and no leading slash - resolves against process.cwd() instead of a stable location. - Windows: spec says C:\Program Files (x86)\Common Files, code returned relative "Program Files\Common Files" - missing the drive letter and "(x86)". Mac was already correct. Linux now joins onto os.homedir() (also keeping the default writable without elevation, consistent with the unprivileged archive-install path in ManagerLocal.install()). Windows now prefers the %ProgramFiles(x86)% env var (matching the existing pattern in dirApp() for %APPDATA%) with the spec's literal path as a fallback. Updated the test that had been asserting the old, buggy values. Note: this changes the default pluginsDir for existing installs on Linux/Windows - anyone relying on the old default location will need to move their files or reconfigure pluginsDir. Co-Authored-By: Claude Sonnet 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
dirPlugins()returned bare relative paths that didn't match the spec's directory table (flagged in an internal spec-compliance audit):$HOME/usr/local/lib— code returned relativeusr/local/libwith no$HOMEand no leading slash, resolving againstprocess.cwd()instead of a stable location.C:\Program Files (x86)\Common Files— code returned relativeProgram Files\Common Files, missing the drive letter and(x86).os.homedir(), which also keeps the default writable without elevation — consistent with the unprivileged archive-install path added inManagerLocal.install()for issue Archive plugin installs unnecessarily require administrator elevation #83.%ProgramFiles(x86)%env var (matching the existing%APPDATA%pattern already used indirApp()), falling back to the spec's literal path.tests/helpers/file.test.ts, which had been asserting the old, buggy values — this is why the bug went unnoticed.Note: this changes the default
pluginsDirfor existing installs on Linux/Windows. Anyone relying on the old (broken) default location will need to move their files or reconfigurepluginsDir.Test plan
npm run checkpasses locally (format, lint, build, tests — 191/191, macOS)🤖 Generated with Claude Code