aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/brew.h.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/Library/Homebrew/brew.h.rb b/Library/Homebrew/brew.h.rb
index f11448d21..2cfc47b94 100644
--- a/Library/Homebrew/brew.h.rb
+++ b/Library/Homebrew/brew.h.rb
@@ -449,9 +449,12 @@ private
# strip unlinks the file and recreates it, thus breaking hard links!
# is this expected behaviour? patch does it too… still, this fixes it
tmp = `/usr/bin/mktemp -t homebrew_strip`.chomp
- `/usr/bin/strip #{args} -o #{tmp} #{path}`
- `/bin/cat #{tmp} > #{path}`
- File.unlink tmp
+ begin
+ `/usr/bin/strip #{args} -o #{tmp} #{path}`
+ `/bin/cat #{tmp} > #{path}`
+ ensure
+ FileUtils.rm tmp
+ end
end
end