mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 08:33:58 +02:00
Overwrite destination symlink file if remove_destination
is set.
[Bug #13914][ruby-core:82846] Patch by @mzp https://github.com/ruby/fileutils/pull/9 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
418771316c
commit
0242f7ccae
2 changed files with 20 additions and 3 deletions
|
@ -412,7 +412,7 @@ module FileUtils
|
|||
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.unlink destent.path if remove_destination && (File.file?(destent.path) || File.symlink?(destent.path))
|
||||
ent.copy destent.path
|
||||
end, proc do |ent|
|
||||
destent = Entry_.new(dest, ent.rel, false)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue