Skip to content

Instantly share code, notes, and snippets.

@tavisto
Last active August 29, 2015 13:56
Show Gist options
  • Save tavisto/8835057 to your computer and use it in GitHub Desktop.
Save tavisto/8835057 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
BREW='/usr/local/bin/brew'
if [ -f $BREW ]; then
echo "Tapping all the kegs!"
taps='homebrew/versions'
tapped=`$BREW tap`
for tap in $taps
do
if [[ "$tapped" != *$tap* ]]
then
brew_command="$BREW tap $tap"
$brew_command
fi
done
echo "Updating brew"
$BREW update
echo "Installing stuff if needed"
packages='git bash bash-completion2 homebrew/completions/vagrant-completion'
installed=`$BREW list`
for package in $packages
do
if [[ "$installed" != *$package* ]]
then
brew_command="$BREW install $package"
$brew_command
fi
done
echo "Upgrading stuff"
$BREW upgrade
echo "Linking stuff"
$BREW linkapps
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment