Allow cp to overwrite existing files (#1339)

This commit is contained in:
Ishan Bhanuka
2020-02-05 12:24:05 +05:30
committed by GitHub
parent 7a0bc6bc46
commit 427bde83f7
2 changed files with 20 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ impl Shell for FilesystemShell {
if entry.is_file() {
let strategy = |(source_file, _depth_level)| {
if destination.exists() {
if destination.is_dir() {
let mut new_dst = dunce::canonicalize(destination.clone())?;
if let Some(name) = entry.file_name() {
new_dst.push(name);