Homebrew是完全基于ruby和git的,Mac OS本身自带ruby,所以安装更简单。
只需执行如下命令即可:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
首先会安装如下脚本:
==> This script will install:
/usr/local/bin/brew #brew命令
/usr/local/share/doc/homebrew #homewbrew文档目录
/usr/local/share/man/man1/brew.1 #brew的可以操作的指令
/usr/local/share/zsh/site-functions/_brew #可用于zsh的brew相关函数
/usr/local/etc/bash_completion.d/brew #brew的自动补全配置
/usr/local/Homebrew #Homebrew的安装主目录
其次它会创建如下目录:
#创建下载程序的目录,如果是非root账号下安装的homebrew,该目录会在最后变成~/Library/Caches/Homebrew
==> /usr/bin/sudo /bin/mkdir -p /Library/Caches/Homebrew