lib/metanorma/collection/renderer/fileprocess.rb in metanorma-2.0.0 vs lib/metanorma/collection/renderer/fileprocess.rb in metanorma-2.0.1
- old
+ new
@@ -49,10 +49,11 @@
out = Pathname.new(@files.get(identifier, :out_path)).cleanpath
out.absolute? and
out = out.relative_path_from(File.expand_path(FileUtils.pwd))
dest = File.join(@outdir, @disambig.source2dest_filename(out.to_s))
FileUtils.mkdir_p(File.dirname(dest))
- FileUtils.cp @files.get(identifier, :ref), dest
+ source = @files.get(identifier, :ref)
+ source != dest and FileUtils.cp source, dest
end
# process each file in the collection
# files are held in memory, and altered as postprocessing
def files # rubocop:disable Metrics/AbcSize, Metrics/MethodLength