diff --git a/mac-homebrew-install.sh b/mac-homebrew-install.sh index 81943c6..81f446c 100644 --- a/mac-homebrew-install.sh +++ b/mac-homebrew-install.sh @@ -4,6 +4,8 @@ echo "Installing Homebrew on MacOS" /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # default brew path: /opt/homebrew for Apple Silicon, /usr/local/Homebrew for macOS Intel and /home/linuxbrew/.linuxbrew for Linux +echo "if `brew --repo homebrew/core` not exists, you may need to git clone https://github.com/Homebrew/homebrew-core.git as well as for homebrew-cask" + # add brew to path on Apple Silicon: # (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/luk/.bash_profile # eval "$(/opt/homebrew/bin/brew shellenv)" @@ -18,4 +20,4 @@ echo "Installing Homebrew on MacOS" # uninstall: https://github.com/homebrew/install#uninstall-homebrew # /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)" -# install emacs: brew cask install emacs + diff --git a/mac-homebrew-china.sh b/mac-homebrew-mirror.sh similarity index 72% rename from mac-homebrew-china.sh rename to mac-homebrew-mirror.sh index 594d54c..5f963a7 100644 --- a/mac-homebrew-china.sh +++ b/mac-homebrew-mirror.sh @@ -4,25 +4,25 @@ read -p '>>> ' TARGET if [ "$TARGET" = 'g' ] then git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git - git -C "$(brew --repo homebrew-core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git - git -C "$(brew --repo homebrew-cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask + git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git + git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask elif [ "$TARGET" = 'z' ] then git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git - git -C "$(brew --repo homebrew-core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git - git -C "$(brew --repo homebrew-cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git + git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git + git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles elif [ "$TARGET" = 'q' ] then git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git - git -C "$(brew --repo homebrew-core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git - git -C "$(brew --repo homebrew-cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git + git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git + git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles elif [ "$TARGET" = 'a' ] then git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git - git -C "$(brew --repo homebrew-core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git - git -C "$(brew --repo homebrew-cask)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-cask.git + git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git + git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-cask.git export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles else exit 0 diff --git a/proxy.sh b/proxy.sh index 6d236c5..c7e0526 100755 --- a/proxy.sh +++ b/proxy.sh @@ -1,9 +1,11 @@ #!/bin/bash +echo "=== Please run with 'source proxy.sh', otherwise it has no effect on the current shell" + if [ -n "$1" ]; then proxySwitch="$1" else - echo "=== 开启或关闭网络代理? s or 1 for start, t or 0 for terminate, anything else for no change." + echo "=== 开启或关闭网络代理? [s/1] for start, [t/0] for terminate, [anything else] for no change." read -p ">>> " proxySwitch fi