mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
install: fix bug #1823
This commit is contained in:
parent
0e217e202a
commit
0f7423dfa6
1 changed files with 18 additions and 11 deletions
|
@ -426,18 +426,25 @@ fn copy_files_into_dir(files: &[PathBuf], target_dir: &PathBuf, b: &Behavior) ->
|
||||||
|
|
||||||
let mut all_successful = true;
|
let mut all_successful = true;
|
||||||
for sourcepath in files.iter() {
|
for sourcepath in files.iter() {
|
||||||
let targetpath = match sourcepath.as_os_str().to_str() {
|
if !sourcepath.exists() {
|
||||||
Some(name) => target_dir.join(name),
|
show_error!(
|
||||||
None => {
|
"cannot stat '{}': No such file or directory",
|
||||||
show_error!(
|
sourcepath.display()
|
||||||
"cannot stat '{}': No such file or directory",
|
);
|
||||||
sourcepath.display()
|
|
||||||
);
|
|
||||||
|
|
||||||
all_successful = false;
|
all_successful = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
|
if sourcepath.is_dir() {
|
||||||
|
show_info!("omitting directory '{}'", sourcepath.display());
|
||||||
|
all_successful = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
let mut targetpath = target_dir.clone().to_path_buf();
|
||||||
|
let filename = sourcepath.components().last().unwrap();
|
||||||
|
targetpath.push(filename);
|
||||||
|
|
||||||
if copy(sourcepath, &targetpath, b).is_err() {
|
if copy(sourcepath, &targetpath, b).is_err() {
|
||||||
all_successful = false;
|
all_successful = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue