Skip to content

Instantly share code, notes, and snippets.

@crahan
Last active May 5, 2017 19:21
Show Gist options
  • Save crahan/30bf69fa24d2ed0b1570 to your computer and use it in GitHub Desktop.
Save crahan/30bf69fa24d2ed0b1570 to your computer and use it in GitHub Desktop.
Update forked OS X Homebrew install (using upstream origin)
function brewup () {
local BREW_PWD=`pwd`
local BREW_PREFIX=`brew --prefix`
local BREW_TAPS=$BREW_PREFIX/Library/taps
cd $BREW_PREFIX
echo "Update to latest git commit."
git checkout master
git fetch upstream
git merge upstream/master
git push origin master
echo "Update all taps."
for repo in `find $BREW_TAPS -type d -a -iname .git`
do
cd `dirname $repo`
echo -n "`dirname $repo`: "
git pull
done
cd $BREW_PWD;
echo "Upgrade outdated packages."
brew upgrade `brew outdated`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment