Skip to content

Commit

Permalink
fix: brew path on M-chip
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Nov 9, 2024
1 parent d6d024f commit a3918b7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ is_arch() {
command -v pacman >/dev/null 2>&1
}

is_x86_64() {
[ $(uname -m) = "x86_64" ]
}

is_arm64() {
[ $(uname -m) = "arm64" ]
}

sync_repo() {
local repo_uri="$1"
local repo_path="$2"
Expand Down Expand Up @@ -173,6 +181,12 @@ if is_mac && ! command -v brew >/dev/null 2>&1; then
# /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"

if is_arm64; then
echo >> $HOME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi

# Tap cask-upgrade
brew tap buo/cask-upgrade

Expand Down
6 changes: 6 additions & 0 deletions install_brew.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ function check {

xcode-select --install
/bin/bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/Homebrew/install@HEAD/install.sh)"

if is_arm64; then
echo >> $HOME/.zprofile
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> $HOME/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
fi
}

Expand Down

0 comments on commit a3918b7

Please sign in to comment.