feat(install.sh): install Rosetta for M1 Mac, fix path for Brew for M1/Intel

This commit is contained in:
Anton Shubin 2022-02-02 12:54:23 +01:00
parent cb671f5947
commit 62f4cf1884

View File

@ -3,9 +3,18 @@ set -e
script_dir="$PWD"
# Rosetta (For Apple Silicon (M1) CPUs only)
if [[ $(uname -p) == 'arm' ]]; then
sudo softwareupdate --install-rosetta
fi
echo '▶️ Installing Brew...'
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$($(brew --prefix)/bin/brew shellenv)"' >> ~/.zprofile
if [[ $(uname -p) == 'arm' ]]; then
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
else
echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
fi
eval "$($(brew --prefix)/bin/brew shellenv)"
echo '✅ Brew installation complete \n'