Fixed mv not moving files on Windows. (#1342)

Move files correctly in windows.
This commit is contained in:
George Tsomlektsis
2020-02-07 18:24:01 +02:00
committed by GitHub
parent 44a114111e
commit ed86b1fbe8
2 changed files with 54 additions and 0 deletions

View File

@ -720,6 +720,22 @@ impl Shell for FilesystemShell {
}
Ok(o) => o,
}
} else if src.is_file() {
match std::fs::copy(src, dst) {
Err(e) => {
return Err(ShellError::labeled_error(
format!(
"Moving file {:?} to {:?} aborted. {:}",
src,
dst,
e.to_string(),
),
e.to_string(),
name_tag,
));
}
Ok(_o) => (),
}
}
}