Add install_mac logic

Checks if homebrew (brew) is installed then uses it to install the dependencies.

Exits if homebrew is not installed and if homebrew fails to install a package.
This commit is contained in:
0xmachos
2018-03-25 11:31:08 +01:00
parent e0fea2adbf
commit ef1d3242f8

25
install
View File

@@ -115,8 +115,29 @@ install_freebsd () {
}
install_mac () {
# brew install ...
echo
local mac_deps=(curl git nodejs python3 \
openssl readline libyaml sqlite3 libxml2 \
autoconf ncurses automake libtool \
bison wget)
if command_exists brew; then
fatal "Homebrew (https://brew.sh/) required to install dependencies"
fi
info "Installing dependencies via brew"
brew update
for package in "${mac_deps[@]}"; do
if brew install "${package}"; then
info "${package} installed"
else
fatal "Failed to install ${package}"
fi
done
}