Last active
August 29, 2015 14:19
-
-
Save cburyta/9ecaa7463086c6484480 to your computer and use it in GitHub Desktop.
Fix / set homebrew multiuser permissions
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
#!/bin/bash | |
# reference: http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/ | |
# usage: bash -c "$(curl -fsSL https://gist.githubusercontent.com/cburyta/9ecaa7463086c6484480/raw/4f756d43fd1b7aebccec6ea49f30dd3b3faf76f0/fix-group-brew.sh)" | |
# stop if brew doctor fails | |
set -e | |
echo "Ensure we have a 'brew' group, if not exists create the brew group before continuing." | |
dscl . -read /Groups/brew | |
echo "Ensure the current user is in the brew group" | |
id $(whoami) | grep brew | |
echo "Ensure Homebrew install looks A-OK" | |
brew doctor | |
echo "... Change the group of homebrew installation directory" | |
sudo chgrp -R brew /usr/local | |
echo "... Allow group members to write inside this directory" | |
sudo chmod -R g+w /usr/local | |
echo "... Change the group of homebrew cache directory" | |
sudo chgrp -R brew /Library/Caches/Homebrew | |
echo "... Allow group members to write inside this directory" | |
sudo chmod -R g+w /Library/Caches/Homebrew | |
echo "... Checking brew doctor again" | |
brew doctor | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment