fix: implement install-dir override chain in the installer - #44079
Open
SomSamantray wants to merge 1 commit into
Open
fix: implement install-dir override chain in the installer#44079SomSamantray wants to merge 1 commit into
SomSamantray wants to merge 1 commit into
Conversation
OPENCODE_INSTALL_DIR > XDG_BIN_DIR > $HOME/bin > $HOME/.opencode/bin, matching README.md's Installation Directory section. The install script previously hardcoded $HOME/.opencode/bin and ignored both env vars entirely. Closes anomalyco#43772
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
This PR appears to address the same issue—implementing the install directory override chain for |
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.
Issue for this PR
Closes #43772
Related: #42974 (duplicate report of the same root cause)
Type of change
What does this PR do?
README.mddocuments a four-level priority chain for the install directory ($OPENCODE_INSTALL_DIR->$XDG_BIN_DIR->$HOME/bin->$HOME/.opencode/bin), but theinstallscript ignored both env vars and always installed to$HOME/.opencode/bin. This implements the chain exactly as documented: check$OPENCODE_INSTALL_DIR, then$XDG_BIN_DIR, then try creating$HOME/bin, and only fall back to$HOME/.opencode/binwhen none of those apply. No other install-script behavior changes.How did you verify your code works?
No test harness exists for the
installshell script in this repo, so I exercised the modified block in isolation withenv -ito controlHOME/env vars per case:$OPENCODE_INSTALL_DIRset alone -> used$XDG_BIN_DIRset alone -> used$OPENCODE_INSTALL_DIRwins$HOME/binmissing but creatable -> created and used$HOME/binalready exists -> used$HOME/binuncreatable (read-only$HOME) -> falls back to$HOME/.opencode/bin$OPENCODE_INSTALL_DIRexported empty -> treated as unset, falls throughAll 8 checks passed. Also ran
bash -n install(syntax check) and confirmedgit difftouches only theINSTALL_DIRresolution block (lines 68-69 originally).Screenshots / recordings
N/A — shell script change, no UI.
Checklist