From 90c7029144d6441bd8594c7e5c843e3aee583ffb Mon Sep 17 00:00:00 2001 From: Max Howell Date: Wed, 29 Jul 2009 00:56:22 +0100 Subject: [PATCH] Fix brew rm --- Library/Homebrew/keg.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 8330c650f2..f724a068ed 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -80,9 +80,13 @@ class Keg end def rm + # don't rmtree shit if we aren't positive about our location! + raise "Bad stuff!" unless path.parent.parent == $cellar + if path.directory? FileUtils.chmod_R 0777, path # ensure we have permission to delete - path.rmtree + path.rmtree # $cellar/foo/1.2.0 + path.parent.rmdir if path.parent.children.length == 0 # $cellar/foo end end