brew国内镜像加速

# 清华源
BREW_BASE_URL='https://mirrors.tuna.tsinghua.edu.cn/git/homebrew'

echo_ok "安装brew ..."
sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
echo_ok "使用国内brew源 ..."
git -C "$(brew --repo)" remote set-url origin $BREW_BASE_URL/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin $BREW_BASE_URL/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin $BREW_BASE_URL/homebrew-cask.git
brew update
chown -R $USER /usr/local/Caskroom

Last updated

Was this helpful?