Skip to content
Snippets Groups Projects
Commit 61ef3942 authored by fauno's avatar fauno
Browse files

remove files from previous builds

parent 2066dacb
Branches antifascista
No related tags found
No related merge requests found
......@@ -6,12 +6,26 @@ module Jekyll
# the file
def write(dest)
dest_path = destination(dest)
return if File.exist? dest_path
# If the file exists but it's not a hardlink, we remove it and
# replace it with one. This is useful when migrating from a site
# already built without this plugin.
if File.exist? dest_path
return if hardlink? dest_path
FileUtils.rm dest_path
end
self.class.mtimes[path] = mtime
FileUtils.mkdir_p(File.dirname(dest_path))
FileUtils.ln(path, dest_path)
end
private
# Verifies the path has hardlinks
def hardlink?(path)
File.stat(path).nlink > 1
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