aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/brew5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/brew b/bin/brew
index a0feec3f7..cc89e9263 100755
--- a/bin/brew
+++ b/bin/brew
@@ -135,7 +135,10 @@ begin
clean f
raise "Nothing was installed to #{f.prefix}" unless f.installed?
rescue Exception
- f.prefix.rmtree if f.prefix.directory?
+ if f.prefix.directory?
+ f.prefix.rmtree
+ f.prefix.parent.rmdir_if_possible
+ end
raise
end