From f7231d1b86cb10087cf64d62b8352ccd6b8d23a6 Mon Sep 17 00:00:00 2001 From: Kerman Date: Thu, 12 Mar 2026 17:12:20 +1300 Subject: [PATCH] fix: prioritize .bash_profile over .bashrc for bash on macOS On macOS, Terminal.app opens login shells which source ~/.bash_profile, not ~/.bashrc. The installer was writing the PATH export to ~/.bashrc first (since it exists by default), causing `opencode` to not be found in new terminal sessions. Fix by reordering config file candidates on darwin so ~/.bash_profile takes priority over ~/.bashrc. Co-Authored-By: Claude Sonnet 4.6 --- install | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/install b/install index b0716d53208..848beeb9241 100755 --- a/install +++ b/install @@ -386,7 +386,13 @@ case $current_shell in config_files="${ZDOTDIR:-$HOME}/.zshrc ${ZDOTDIR:-$HOME}/.zshenv $XDG_CONFIG_HOME/zsh/.zshrc $XDG_CONFIG_HOME/zsh/.zshenv" ;; bash) - config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile" + # On macOS, Terminal opens login shells which source .bash_profile, not .bashrc. + # Prioritize .bash_profile on macOS to ensure the PATH update takes effect. + if [[ "$os" == "darwin" ]]; then + config_files="$HOME/.bash_profile $HOME/.bashrc $HOME/.profile $XDG_CONFIG_HOME/bash/.bash_profile $XDG_CONFIG_HOME/bash/.bashrc" + else + config_files="$HOME/.bashrc $HOME/.bash_profile $HOME/.profile $XDG_CONFIG_HOME/bash/.bashrc $XDG_CONFIG_HOME/bash/.bash_profile" + fi ;; ash) config_files="$HOME/.ashrc $HOME/.profile /etc/profile"