From 62f4cf188418ecff3296eadea2821206d22ca9dd Mon Sep 17 00:00:00 2001 From: Anton Shubin <2spy4x@gmail.com> Date: Wed, 2 Feb 2022 12:54:23 +0100 Subject: [PATCH] feat(install.sh): install Rosetta for M1 Mac, fix path for Brew for M1/Intel --- install.sh | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 8884b78..b90f4a6 100644 --- a/install.sh +++ b/install.sh @@ -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'