Only delete a file if it actually exists.

This commit is contained in:
Moritz Bunkus 2005-01-11 08:18:34 +00:00
parent c186560202
commit 96ba68b2e9

View File

@ -66,7 +66,7 @@ class Test
def hash_tmp(erase = true) def hash_tmp(erase = true)
output = hash_file(@tmp) output = hash_file(@tmp)
if (erase) if (erase)
File.unlink(@tmp) File.unlink(@tmp) if (File.exists?(@tmp))
@debug_commands.push("rm #{@tmp}") @debug_commands.push("rm #{@tmp}")
@tmp = nil @tmp = nil
end end