eval "$(/opt/homebrew/bin/brew shellenv)"

# Search for Homebrew in its preferred locations:
# https://docs.brew.sh/Installation
for prefix in "/opt/homebrew" "/usr/local"; do
  if [ -x "$prefix/bin/brew" ]; then
    eval "$($prefix/bin/brew shellenv)"
    break
  fi
done

Fix Homebrew setup on Intel Macs
Fix Homebrew setup on Intel Macs

Homebrew installs to different prefixes on Apple Silicon and Intel Macs:
https://docs.brew.sh/Installation
