Repository navigation
fix(install): create ~/.zshrc when it's missing so opencode lands on PATH - #57348
Draft
kitlangton wants to merge 1 commit into
Draft
kitlangton wants to merge 1 commit into
kitlangton wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Today
A new Mac has no
~/.zshrc. When someone runscurl -fsSL https://opencode.ai/v2/install | bashon one, the installer finds no zsh config file, printsNo config file found for zsh. You may need to manually add to PATH, and stops there. The next command they type,opencode, fails withcommand not found.After
When none of the zsh (or fish) config files exist, the installer creates the shell's main one (
${ZDOTDIR:-$HOME}/.zshrc, or~/.config/fish/config.fish) and adds thePATHline to it as usual. Bash and other shells keep today's warning, because on macOS a login bash reads.bash_profileand guessing the wrong file would hide the problem.How
install: before the "No config file found" branch, pick the shell's main config file,mkdir -pits folder andtouchit. If either step fails, the old warning still prints.Proof
On a throwaway
HOMEwithSHELL=/bin/zshand no dotfiles:A second run prints
Command already exists in /tmp/onb-home/.zshrc, skipping write., and--no-modify-pathstill creates no files.Risk
Low. It only runs when no candidate file exists, and only for zsh and fish. Undo is a one-line revert.