fix(install): Add instructions to source config file in install#27733
Open
srivenkateswaran6002 wants to merge 2 commits into
Open
fix(install): Add instructions to source config file in install#27733srivenkateswaran6002 wants to merge 2 commits into
srivenkateswaran6002 wants to merge 2 commits into
Conversation
Print a short message at the end of the install script showing how to source the opencode config for the current session. Uses $config_file if set, otherwise shows the first file from $config_files, and also suggests opening a new terminal tab/window.
Contributor
|
Hey! Your PR title Please update it to start with one of:
Where See CONTRIBUTING.md for details. |
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 #27732
Type of change
What does this PR do?
After running the install script,
opencodeis added to the shell config file but the current session doesn't pick up the newPATHentry. New users often try runningopencodeimmediately and getcommand not foundbecause they don't realize they need to reload their shell config or open a new terminal.The script already detects the correct config file (stored in
$config_filewhen found, or a list in$config_filesas fallback). This PR reuses that existing logic to print a short message at the end of installation telling the user exactly how to activate it for the current session:source <that_file>$config_filesHow did you verify your code works?
Tested locally on macOS with a fresh install:
~/.opencodeand the PATHexport from~/.zshrcto simulate a first-time install.source ~/.zshrccommand.opencode --versionin the same terminal before sourcing and confirmed it fails withcommand not found.opencode --versionwhich works as expectedScreenshots / recordings
Checklist
**Note : ** The fix is adding the following lines to the end of the
installscript.