Skip to content

Commit 317ba3a

Browse files
committed
Detect Homebrew location for Intel support
The hardcoded `/opt/homebrew/bin/brew` path only works on Apple Silicon Macs. Intel Macs install Homebrew to `/usr/local/bin/brew`. Check both paths before eval-ing shellenv. Closes #781
1 parent 0db29b2 commit 317ba3a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

zshrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ _load_settings() {
3434
}
3535
_load_settings "$HOME/.zsh/configs"
3636

37-
eval "$(/opt/homebrew/bin/brew shellenv)"
37+
if [ -x /opt/homebrew/bin/brew ]; then
38+
eval "$(/opt/homebrew/bin/brew shellenv)"
39+
elif [ -x /usr/local/bin/brew ]; then
40+
eval "$(/usr/local/bin/brew shellenv)"
41+
fi
3842

3943
export PATH="${ASDF_DATA_DIR:-$HOME/.asdf}/shims:$PATH"
4044

0 commit comments

Comments
 (0)