lib/relaton/db_cache.rb in relaton-1.7.6 vs lib/relaton/db_cache.rb in relaton-1.7.7
- old
+ new
@@ -15,11 +15,17 @@
# set_version # unless File.exist? file_version
end
# Move caches to anothe dir
# @param new_dir [String, nil]
+ # @return [String, nil]
def mv(new_dir)
return unless new_dir && @ext == "xml"
+
+ if File.exist? new_dir
+ warn "[relaton] WARNING: target directory exists \"#{new_dir}\""
+ return
+ end
FileUtils.mv dir, new_dir
@dir = new_dir
end