Skip to content

Commit 06f4df5

Browse files
teknium1erhnysr
andauthored
fix(install): add zprofile fallback and create zshrc on fresh macOS installs (NousResearch#2320)
On macOS, zsh users may not have ~/.zshrc if they haven't customized their shell yet. The installer would silently fail to add ~/.local/bin to PATH, causing 'hermes: command not found' after installation. - Check ~/.zprofile as fallback for zsh users (macOS login shell config) - Create ~/.zshrc if neither config file exists Cherry-picked from PR NousResearch#2315 by erhnysr. Co-authored-by: erhnysr <erhnysr@users.noreply.github.com>
1 parent a03cbcd commit 06f4df5

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,12 @@ setup_path() {
772772
case "$LOGIN_SHELL" in
773773
zsh)
774774
[ -f "$HOME/.zshrc" ] && SHELL_CONFIGS+=("$HOME/.zshrc")
775+
[ -f "$HOME/.zprofile" ] && SHELL_CONFIGS+=("$HOME/.zprofile")
776+
# If neither exists, create ~/.zshrc (common on fresh macOS installs)
777+
if [ ${#SHELL_CONFIGS[@]} -eq 0 ]; then
778+
touch "$HOME/.zshrc"
779+
SHELL_CONFIGS+=("$HOME/.zshrc")
780+
fi
775781
;;
776782
bash)
777783
[ -f "$HOME/.bashrc" ] && SHELL_CONFIGS+=("$HOME/.bashrc")

0 commit comments

Comments
 (0)