Add brew shellenv to shell profile in macOS install guide (#5993)

This commit is contained in:
Jakub Kuczys 2023-04-13 18:48:47 +02:00 committed by GitHub
parent 44e129bc66
commit a70f444255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -17,6 +17,9 @@ following, then press Enter:
.. prompt:: bash .. prompt:: bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew_location="$([ -n "$HOMEBREW_PREFIX" ] && echo "$HOMEBREW_PREFIX" || ([ "$(/usr/bin/uname -m)" = "arm64" ] && echo /opt/homebrew || echo /usr/local))/bin/brew"
printf '\neval "$(%s shellenv)"\n' "$brew_location" >> "$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile))"
eval "$("$brew_location" shellenv)"
After the installation, install the required packages by pasting the commands and pressing enter, After the installation, install the required packages by pasting the commands and pressing enter,
one-by-one: one-by-one:
@ -33,9 +36,8 @@ To fix this, you should run these commands:
.. prompt:: bash .. prompt:: bash
profile=$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile)) echo 'export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"' >> "$([ -n "$ZSH_VERSION" ] && echo ~/.zprofile || ([ -f ~/.bash_profile ] && echo ~/.bash_profile || echo ~/.profile))"
echo 'export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"' >> "$profile" export PATH="$(brew --prefix)/opt/python@3.11/bin:$PATH"
source "$profile"
.. Include common instructions: .. Include common instructions: