Skip to content

Commit 1f4f79b

Browse files
committed
ensure tempfile is deleted
1 parent f9736a4 commit 1f4f79b

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/closure/compiler.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ def compile(io)
2929
else
3030
tempfile.write(io.to_s)
3131
end
32-
tempfile.close
32+
tempfile.flush
3333

3434
begin
3535
result = `#{command} --js #{tempfile.path}`
3636
rescue Exception
3737
raise Error, "compression failed"
38+
ensure
39+
tempfile.close!
3840
end
3941
unless $?.exitstatus.zero?
4042
raise Error, result

0 commit comments

Comments
 (0)