Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using different paths for M1 or Intel processor #210

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robertobermejo
Copy link

As you can see in the Brew.sh documentation, there are different paths depending on the Mac's processor.

This script installs Homebrew to its preferred prefix (/usr/local for macOS Intel, /opt/homebrew for Apple Silicon and /home/linuxbrew/.linuxbrew for Linux) so that you don’t need sudo when you brew install. It is a careful script; it can be run even if you have stuff installed in the preferred prefix already. It tells you exactly what it will do before it does it too. You have to confirm everything it will do before it starts.

@gtrabanco
Copy link
Contributor

gtrabanco commented Apr 18, 2022

The best approach is to use HOBREW_PREFIX env or get the brew prefix by executing brew --prefix. You can see an example in this url where I have it fixed:

Comment on lines +25 to +29
if [[ $(uname -m) == 'arm64' ]]; then
ZSH_BIN_PATH='/opt/homebrew/bin/zsh'
else
ZSH_BIN_PATH='/usr/local/bin/zsh'
fi
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZSH_BIN_PATH="$(brew --prefix zsh)"

You can get the prefix of installed packages with brew with brew --prefix <package>

But could happen that the command is being executed in a system without brew or installed in other way or with brew prefix not added but installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants