Skip to content

Instantly share code, notes, and snippets.

@c10l
Created February 15, 2016 09:43
Show Gist options
  • Save c10l/a182ebaedf6b014cbc70 to your computer and use it in GitHub Desktop.
Save c10l/a182ebaedf6b014cbc70 to your computer and use it in GitHub Desktop.
Fix Homebrew on OS X El Capitan
function _brew () {
for f in /usr/local/*; do
if [ ! -w "${f}" ]; then
echo 'Fixing /usr/local ownership...'
sudo chown -R $(whoami):admin /usr/local
break
fi
done
brew $*
}
alias brew=_brew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment