Skip to content

Commit

Permalink
Update brew taps
Browse files Browse the repository at this point in the history
  • Loading branch information
seagle0128 committed Feb 16, 2025
1 parent c6f4025 commit ed3f082
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .zshrc.local
Original file line number Diff line number Diff line change
Expand Up @@ -69,19 +69,17 @@ if [[ $OSTYPE == darwin* ]]; then

function set_homebrew_env()
{
# https://mirrors.ustc.edu.cn/
# https://mirrors.tnua.tsinghua.edu.cn/
# https://mirrors.bfsu.edu.cn/
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
export HOMEBREW_PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
# Mirrors: https://mirrors.ustc.edu.cn/, https://mirrors.tnua.tsinghua.edu.cn/
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git"
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
export HOMEBREW_PIP_INDEX_URL="https://mirrors.ustc.edu.cn/pypi/simple"
}

function set_homebrew_mirror() {
set_homebrew_env
brew tap --custom-remote --force-auto-update homebrew/command-not-found https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-command-not-found.git
brew tap --custom-remote --force-auto-update homebrew/services https://mirrors.ustc.edu.cn/homebrew-services.git
brew update
}

Expand All @@ -98,9 +96,9 @@ if [[ $OSTYPE == darwin* ]]; then
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew

BREW_TAPS="$(BREW_TAPS="$(brew tap 2>/dev/null)"; echo -n "${BREW_TAPS//$'\n'/:}")"
for tap in core cask command-not-found; do
for tap in core cask services; do
if [[ ":${BREW_TAPS}:" == *":homebrew/${tap}:"* ]]; then
brew tap --custom-remote "homebrew/${tap}" "https://github.com/Homebrew/homebrew-${tap}"
brew tap --custom-remote --force-auto-update "homebrew/${tap}" "https://github.com/Homebrew/homebrew-${tap}"
fi
done

Expand Down

0 comments on commit ed3f082

Please sign in to comment.