为 brew tap 使用代理地址

使用 homebrew 管理 Emacs 的时候,经常遇到从 GitHub 拉取慢的问题,通常全使用 ghproxy.com 的镜像代理来加速下载,但是在使用 tap 的过程中,下载的路径是从 homebrew 中获取的,所以一直无法利用代理加速。

今天阅读的时候发现可以利用 --custom-remote 来使用代理地址,以 emacs-plus 为例。

按 Readme 中的方式进行添加:

brew tap d12frosted/emacs-plus

现在我们可以将命令修改为:

brew tap d12frosted/emacs-plus --custom-remote https://ghproxy.com/https://github.com/d12frosted/homebrew-emacs-plus

后面再更新的时候,就可以利用代理来更新配置了。