Skip to content

Instantly share code, notes, and snippets.

@markuskreitzer
Created July 25, 2018 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markuskreitzer/79a1e0a254c846a13f4e8a6d1273565f to your computer and use it in GitHub Desktop.
Save markuskreitzer/79a1e0a254c846a13f4e8a6d1273565f to your computer and use it in GitHub Desktop.
Hack brew to always keep a copy of your latests casks and brews on Dropbox
# Append the following to your .bashrc or file that contains your user profile:
function brew(){
case $1 in
install)
echo "Install"
/usr/local/bin/brew $*
/usr/local/bin/brew list > ~/Dropbox/new_comp/mac/brews_autolisted.txt
;;
cask)
echo "Cask"
if [[ $2 == 'install' ]]
then
echo "Cask Install"
/usr/local/bin/brew $*
/usr/local/bin/brew cask list > ~/Dropbox/new_comp/mac/brews_autolisted.txt
else
echo "Got: $*"
/usr/local/bin/brew $*
fi
;;
*)
echo "Got: $*"
/usr/local/bin/brew $*
;;
esac
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment