Created
May 26, 2016 22:57
-
-
Save bbonamin/363ee6998c9fb80d0d4eb51f4d798388 to your computer and use it in GitHub Desktop.
Homebrew multi user setup
This file contains hidden or 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
#!/usr/bin/env bash | |
set -eu | |
# | |
# Adapted from http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/ | |
# | |
sudo dseditgroup -q -o create brew | |
sudo dseditgroup -o edit -a "${USER}" -t user brew | |
sudo chgrp -R brew /usr/local # Change the group of homebrew installation directory. | |
sudo chmod -R g+r /usr/local # Allow group members to read inside this directory. | |
sudo chmod -R g+w /usr/local # Allow group members to write inside this directory. | |
sudo find /usr/local -type d -print0 | sudo xargs -0 chmod g+x # Allow group members to exec inside this directory. | |
sudo chmod -R g+w /usr/local # Allow group members to write inside this directory. | |
sudo chgrp -R brew /Library/Caches/Homebrew # Change the group of homebrew cache directory. | |
sudo chmod -R g+w /Library/Caches/Homebrew # Allow group members to write inside this directory. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment