Files

25 lines
1.0 KiB
Nu

export def --env "pj brewthu" [] {
let os_name = ($nu.os-info.name? | default "" | into string | str downcase)
if not (($os_name | str contains "darwin") or ($os_name | str contains "macos")) {
return
}
let bottle_domain = ($env.HOMEBREW_BOTTLE_DOMAIN? | default "")
if ($bottle_domain | is-empty) {
load-env {
HOMEBREW_API_DOMAIN: "https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/api"
HOMEBREW_BOTTLE_DOMAIN: "https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles"
HOMEBREW_BREW_GIT_REMOTE: "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git"
HOMEBREW_CORE_GIT_REMOTE: "https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git"
HOMEBREW_PIP_INDEX_URL: "https://pypi.tuna.tsinghua.edu.cn/simple"
}
} else {
hide-env HOMEBREW_API_DOMAIN
hide-env HOMEBREW_BOTTLE_DOMAIN
hide-env HOMEBREW_BREW_GIT_REMOTE
hide-env HOMEBREW_CORE_GIT_REMOTE
hide-env HOMEBREW_PIP_INDEX_URL
}
}