Skip to content

Commit

Permalink
FormulaInstaller: cleanup files when pouring bottle failed
Browse files Browse the repository at this point in the history
Closes Homebrew/legacy-homebrew#44325.

Signed-off-by: Xu Cheng <xucheng@me.com>
  • Loading branch information
xu-cheng committed Sep 26, 2015
1 parent 7b97dca commit 1b33c70
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,12 @@ def install
begin
install_relocation_tools unless formula.bottle_specification.skip_relocation?
pour
rescue => e
rescue Exception => e
# any exceptions must leave us with nothing installed
ignore_interrupts do
formula.prefix.rmtree if formula.prefix.directory?
formula.rack.rmdir_if_possible
end
raise if ARGV.homebrew_developer?
@pour_failed = true
onoe e.message
Expand Down

0 comments on commit 1b33c70

Please sign in to comment.