Skip to content

Instantly share code, notes, and snippets.

@cruinh
Created April 20, 2023 18:50
Show Gist options
  • Save cruinh/97f29c12524b84fe62eab146ec0d7a70 to your computer and use it in GitHub Desktop.
Save cruinh/97f29c12524b84fe62eab146ec0d7a70 to your computer and use it in GitHub Desktop.
.zshrc script for auto-selecting homebrew path based on system architecture
# The i386 version of homebrew installs to "/usr/local/bin"
# The arm64 version of homebew installs to "/opt/homebrew"
# By default, "/usr/local/bin" is the very first entry in PATH on macs (see "man path_helper" and "/etc/paths")
# Therefore, when not using Rosetta 2, prepend "/opt/homebrew" to PATH to ensure the arm64 version of homebrew is used
if [ "arm64" = `arch` ]; then
export PATH="/opt/homebrew/bin:$PATH"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment