brew requirement
pkill37 opened this issue · comments
pkill37 commented
I just realized I don't check if brew is installed or do anything about it. Should I?
Pedro Martins commented
Yeah, you should. Check out this snipet, I've had it from working on my automation script and may be useful to you:
# Homebrew
printf "Checking for Homebrew... "
if ! command -v brew > /dev/null; then
printf "Homebrew not installed! Installing Homebrew...\n"
ruby -e "$(curl --location --fail --silent --show-error https://raw.githubusercontent.com/Homebrew/install/master/install)"
export PATH="/usr/local/bin:$PATH"
printf "export PATH=\"/usr/local/bin:$PATH\"\n" >> $HOME/.bash_profile
else
printf "Homebrew installed.\n"
fi
printf "Updating Homebrew...\n"
brew update
``
`