Before copying file, explicitly remove the old one
On Windows, FileUtils.cp(path, dest_path) will fail with a Permission Denied if the dest_path already exists and is read-only. People have complained about this since at least 2008. This lets `jekyll build` work without error in Windows when one or more read-only files exist. This change will accommodate users of Team Foundation, which uses the read-only flag for for source control status. (dumb, I know, but but a real problem)
This commit is contained in:
parent
5846cc7b70
commit
74f0f27d18
|
@ -59,6 +59,7 @@ module Jekyll
|
||||||
@@mtimes[path] = mtime
|
@@mtimes[path] = mtime
|
||||||
|
|
||||||
FileUtils.mkdir_p(File.dirname(dest_path))
|
FileUtils.mkdir_p(File.dirname(dest_path))
|
||||||
|
FileUtils.rm(dest_path) if File.exist?(dest_path)
|
||||||
FileUtils.cp(path, dest_path)
|
FileUtils.cp(path, dest_path)
|
||||||
|
|
||||||
true
|
true
|
||||||
|
|
Loading…
Reference in New Issue