Check if homebrew is installed before making functions for it

This commit is contained in:
Henrik Lissner 2013-10-18 09:53:01 -04:00
parent cfaae7e2a7
commit fc21785264

View file

@ -12,17 +12,38 @@ function is_linux {
if is_mac; then if is_mac; then
function pkg_install() { if command_exists brew; then
brew install $1
}
function pkg_remove() { function pkg_install() {
brew remove $1 brew install $1
} }
function pkg_update() { function pkg_remove() {
brew update && brew upgrade brew remove $1
} }
function pkg_update() {
brew update && brew upgrade
}
else
function pkg_install() {
echo_r "Homebrew not installed"
exit 1
}
function pkg_remove() {
echo_r "Homebrew not installed"
exit 1
}
function pkg_update() {
echo_r "Homebrew not installed"
exit 1
}
fi
elif is_deb; then elif is_deb; then