6 function _install_brew() {
7 # Straight from https://brew.sh
8 #/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
10 needs_xcode="$(/usr/bin/xcode-select -p > /dev/null 2> /dev/null || echo "true")"
11 if [[ -n ${needs_xcode} ]]; then
14 echo "ERROR: Run this command to install XCode Command Line Tools first:"
16 echo " xcode-select --install"
18 echo "After the install, close this terminal, open a new one, and try again."
23 # From Straight from https://brew.sh
24 if ! [ -d "$HOME/.local/opt/brew" ]; then
25 echo "Installing to '$HOME/.local/opt/brew'"
27 echo "If you prefer to have brew installed to '/usr/local' cancel now and do the following:"
28 echo " rm -rf '$HOME/.local/opt/brew'"
29 echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
32 git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.local/opt/brew"
35 webi_path_add "$HOME/.local/opt/brew/bin"
36 export PATH="$HOME/.local/opt/brew/bin:$PATH"
38 echo "Updating brew..."
41 webi_path_add "$HOME/.local/opt/brew/sbin"
42 export PATH="$HOME/.local/opt/brew/sbin:$PATH"
44 echo "Installed 'brew' to '$HOME/.local/opt/brew'"
46 echo "If you prefer to have brew installed to '/usr/local' do the following:"
47 echo " mv '$HOME/.local/opt/brew' '$HOME/.local/opt/brew.$(date '+%F_%H-%M-%S').bak'"
48 echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'