Created
March 3, 2012 22:55
-
-
Save pbrisbin/1968825 to your computer and use it in GitHub Desktop.
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
ghc-pkg-clean() { | |
_have ghc-pkg || return 1 | |
while read -r pkg; do | |
echo "attempting to unregister $pkg..." | |
ghc-pkg $* unregister $pkg | |
done <(ghc-pkg $* check |& sed '/^There are problems in package \([^:]*\):$/!d; s//\1/') | |
} | |
ghc-pkg-reset() { | |
read -p 'Are you sure (y/n)? ' ans | |
if [[ "$ans" =~ y*|Y* ]]; then | |
rm -rf "$HOME/.cabal/packages"/*/* | |
rm -rf "$HOME/.cabal/bin"/* | |
rm -rf "$HOME/.ghc" | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment