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}" ]]
15 echo "ERROR: Run this command to install XCode Command Line Tools first:"
17 echo " xcode-select --install"
19 echo "After the install, close this terminal, open a new one, and try again."
24 # From Straight from https://brew.sh
25 if ! [ -d "$HOME/.local/opt/brew" ]; then
26 echo "Installing to '$HOME/.local/opt/brew'"
28 echo "If you prefer to have brew installed to '/usr/local' cancel now and do the following:"
29 echo " rm -rf '$HOME/.local/opt/brew'"
30 echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
33 git clone --depth=1 https://github.com/Homebrew/brew "$HOME/.local/opt/brew"
36 webi_path_add "$HOME/.local/opt/brew/bin"
37 export PATH="$HOME/.local/opt/brew/bin:$PATH"
39 echo "Updating brew..."
42 webi_path_add "$HOME/.local/opt/brew/sbin"
43 export PATH="$HOME/.local/opt/brew/sbin:$PATH"
45 echo "Installed 'brew' to '$HOME/.local/opt/brew'"
47 echo "If you prefer to have brew installed to '/usr/local' do the following:"
48 echo " mv '$HOME/.local/opt/brew' '$HOME/.local/opt/brew.$(date '+%F_%H-%M-%S').bak'"
49 echo ' /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'