Last active
May 5, 2017 19:21
-
-
Save crahan/30bf69fa24d2ed0b1570 to your computer and use it in GitHub Desktop.
Update forked OS X Homebrew install (using upstream origin)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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