fix: prevent path transformation for standard global install location#326
Open
rafaelsnv wants to merge 2 commits into
Open
fix: prevent path transformation for standard global install location#326rafaelsnv wants to merge 2 commits into
rafaelsnv wants to merge 2 commits into
Conversation
Path transformation was incorrectly triggered for standard global installs (~/.config/opencode), replacing .opencode/context/ references with absolute user-specific paths. This caused: - Corruption of local edits on reinstall - Hardcoded paths breaking portability Now transformation only applies to non-standard locations (e.g., /opt/opencode)
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.
What
Fixes #321 and resolves #310 where
/add-contextand/add-context --globalresolved to the same directory.Why
The install script was incorrectly applying path transformation to standard global installs (
~/.config/opencode), causing context paths to resolve to the same location regardless of the--globalflag. This broke the local/global path separation documented incontext-paths.md.How
Modified the path transformation condition in
install.shto skip transformation for standard locations:.opencode/(local relative) - no transformation needed*/.opencode/(local in subdirectory) - no transformation needed~/.config/opencode(global standard) - FIX: now skipped/opt/opencode) - transformation still appliedBefore fix: All paths transformed to install dir, local/global collapsed
After fix: Standard paths preserved, only custom paths transformed
Testing
scripts/tests/test-path-transformation.sh- 9/9 tests passedFiles changed:
install.sh- 27 lines changed (20 insertions, 7 deletions)scripts/tests/test-path-transformation.sh- new test file added