Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Commit

Permalink
Add brew-clean script.
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeMcQuaid committed Jul 3, 2012
1 parent ae1ee91 commit 8374020
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions brew-clean.sh
@@ -0,0 +1,14 @@
#!/bin/sh
# Uninstall all non-whitelisted Homebrew formulae

# Exit on any command failures
set -e

BREW_CLEAN_WHITELIST=~/.brew-clean-whitelist
[ -s $BREW_CLEAN_WHITELIST ]
BREW_LIST=$TMPDIR/brew-list
[ -s $BREW_LIST ]

brew list > $BREW_LIST
comm -13 $BREW_CLEAN_WHITELIST $BREW_LIST | xargs brew uninstall
rm $BREW_LIST

0 comments on commit 8374020

Please sign in to comment.