Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9f1260e3 authored by Cyril Rohr's avatar Cyril Rohr
Browse files

Modified generator so that it doesn't write a hard link if it already exists

parent 04e3cf52
No related branches found
No related tags found
No related merge requests found
...@@ -121,10 +121,10 @@ class ReferenceGenerator ...@@ -121,10 +121,10 @@ class ReferenceGenerator
groups.has_key?(G5K::Link) and groups[G5K::Link].each do |link| groups.has_key?(G5K::Link) and groups[G5K::Link].each do |link|
from = File.join(repository, "#{link.from}.json") from = File.join(repository, "#{link.from}.json")
to = File.join(repository, link.path) to = File.join(repository, link.path)
# Hard links will always be regenerated unless File.exists?(to)
# TODO: find a way to detect if a link has to be regenerated puts "Hard link to be written = \t#{to} -> #{from}"
puts "Hard link to be written = \t#{to} -> #{from}" FileUtils.link(from, to, :force => true) unless options[:simulate]
FileUtils.link(from, to, :force => true) unless options[:simulate] end
end end
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment