add brewthu to use THU source of homebrew
This commit is contained in:
23
zsh/zshrc
23
zsh/zshrc
@@ -110,4 +110,27 @@ source $ZSH/oh-my-zsh.sh
|
|||||||
# Example aliases
|
# Example aliases
|
||||||
# alias zshconfig="mate ~/.zshrc"
|
# alias zshconfig="mate ~/.zshrc"
|
||||||
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
# alias ohmyzsh="mate ~/.oh-my-zsh"
|
||||||
|
|
||||||
|
# Homebrew tsinghua mirror for macOS
|
||||||
|
function brewthu() {
|
||||||
|
if [[ $HOMEBREW_BOTTLE_DOMAIN = "" ]]; then
|
||||||
|
export HOMEBREW_API_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
|
||||||
|
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
|
||||||
|
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_PIP_INDEX_URL="https://pypi.tuna.tsinghua.edu.cn/simple"
|
||||||
|
# Bottles
|
||||||
|
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
|
||||||
|
else
|
||||||
|
unset HOMEBREW_API_DOMAIN
|
||||||
|
unset HOMEBREW_BOTTLE_DOMAIN
|
||||||
|
unset HOMEBREW_BREW_GIT_REMOTE
|
||||||
|
unset HOMEBREW_CORE_GIT_REMOTE
|
||||||
|
unset HOMEBREW_PIP_INDEX_URL
|
||||||
|
# Bottles
|
||||||
|
unset HOMEBREW_BOTTLE_DOMAIN
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# using starship as prompt
|
||||||
eval "$(starship init zsh)"
|
eval "$(starship init zsh)"
|
||||||
|
Reference in New Issue
Block a user