mirror of
https://github.com/nushell/nushell.git
synced 2025-08-16 14:31:02 +02:00
Fixed mv not moving files on Windows. (#1342)
Move files correctly in windows.
This commit is contained in:
committed by
GitHub
parent
44a114111e
commit
ed86b1fbe8
@ -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) => (),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user