Skip to content

Commit

Permalink
Avoid error when latest does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ngiger committed Feb 18, 2014
1 parent 04c67ec commit 0b84d76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin/swissmedic.rb
Expand Up @@ -81,7 +81,7 @@ def update(agent=Mechanize.new, target=get_latest_file(agent))
deactivate @diff.registration_deletions
end_time = Time.now - start_time
@update_time = (end_time / 60.0)
if FileUtils.compare_file(target, @latest)
if File.exists?(target) and File.exists?(@latest) and FileUtils.compare_file(target, @latest)
debug_msg "#{__FILE__}: #{__LINE__} rm_f #{target} after #{@update_time} minutes"
FileUtils.rm_f(target, :verbose => true)
else
Expand Down

0 comments on commit 0b84d76

Please sign in to comment.