diff options
author | Jeremy Evans <[email protected]> | 2019-08-23 14:52:12 -0700 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-09-27 11:39:02 +0900 |
commit | 06c35cfa65ed5e023bb8b82af93a3d711e550913 () | |
tree | 3a39b48faa86aab8f691207778ce34e7e6ee8111 /lib/fileutils.rb | |
parent | 9792c9d183ccc0e80230858c910c74cfef5ddc32 (diff) |
[ruby/fileutils] Fix cp_r with symlink root on Windows
Previously this would copy the symlink root as a symlink instead of creating a new root directory. This modifies the source to expand it using File.realpath before starting the copy. Fixes Ruby Bug 12123 https://.com/ruby/fileutils/commit/7359cef359
-rw-r--r-- | lib/fileutils.rb | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -488,7 +488,11 @@ module FileUtils # If +remove_destination+ is true, this method removes each destination file before copy. # def copy_entry(src, dest, preserve = false, dereference_root = false, remove_destination = false) - Entry_.new(src, nil, dereference_root).wrap_traverse(proc do |ent| destent = Entry_.new(dest, ent.rel, false) File.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path)) ent.copy destent.path |