Skip to content

Commit

Permalink
refactor(mac-bootstrap): extract homebrew right fixing in a script
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayeu committed Nov 5, 2020
1 parent 3da09bd commit a9ff27b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 12 additions & 0 deletions bin.symlink/fix-homebrew-right
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env zsh

if [ $EUID != 0 ]; then
sudo "$0" "$@"
exit $?
fi

MY_GROUP=me_myself_and_i
chmod -R +a "group:${MY_GROUP} allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /usr/local/*
chgrp -R "$MY_GROUP" /usr/local/*
chmod -R g+rwX /usr/local/*
chown -R m /usr/local/{Cellar,Caskroom,Homebrew}
4 changes: 1 addition & 3 deletions bin.symlink/mac-bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ brew analytics off
export HOMEBREW_NO_ANALYTICS=1

echo "🍺 Configure Homebrew to be shared with me, myself, and I"
sudo chmod -R +a "group:${MY_GROUP} allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,file_inherit,directory_inherit" /usr/local/*
sudo chgrp -R "$MY_GROUP" "/usr/local/"
sudo chmod -R g+rwX "/usr/local/"
fix-homebrew-right

echo "🍺 Install Cask apps"
brew cask install \
Expand Down

0 comments on commit a9ff27b

Please sign in to comment.