pkill37 / linuxify

🍏🐧 Transparently transform the macOS CLI into a fresh GNU/Linux CLI experience.
MIT License
888 stars 69 forks source link

brew requirement #5

Closed pkill37 closed 5 years ago

pkill37 commented 5 years ago

I just realized I don't check if brew is installed or do anything about it. Should I?

pbmartins commented 5 years ago

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
``
`