Skip to content

Instantly share code, notes, and snippets.

@colehocking
Last active June 12, 2018 22:10
Show Gist options
  • Save colehocking/db4e1b3c5ae9f40e823d4c8c66d74963 to your computer and use it in GitHub Desktop.
Save colehocking/db4e1b3c5ae9f40e823d4c8c66d74963 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Installation script to load homebrew
# -- Cole Hocking
# -----------------------------------------------------------------------------
# Verify Homebrew installation for package management
# Docs: https://brew.sh/
go_brew() {
echo "Checking for Homebrew package management tool..."
if [[ -f "$(which brew)" ]]; then
echo "Brew is installed!"
exit $?
else
echo "Homebrew is not installed. Please follow the prompts for installation."
echo "(requires sudo for installation)"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
fi
# Confirm that brew is installed before we continue
sync
if [[ ! -f "$(which brew)" ]]; then
echo 'Brew does not installed or installation aborted. Re-run ./install_brew.sh ' > 2
exit 1
else
echo "Brew has been installed successfully!"
fi
}
go_brew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment