mirror of
https://github.com/uutils/coreutils
synced 2024-11-17 18:28:18 +00:00
install: Don't display success message when the dir was not created
Also don't run chmod when we just failed to create the directory. Behaviour before this patch: $ ./target/release/install -v -d dir1/dir2 install: dir1/dir2: Permission denied (os error 13) install: dir1/dir2: chmod failed with error No such file or directory (os error 2) install: created directory 'dir1/dir2'
This commit is contained in:
parent
349c4f7af6
commit
2a02f01fc2
1 changed files with 6 additions and 4 deletions
|
@ -364,15 +364,17 @@ fn directory(paths: Vec<String>, b: Behavior) -> i32 {
|
||||||
if let Err(e) = fs::create_dir(directory) {
|
if let Err(e) = fs::create_dir(directory) {
|
||||||
show_info!("{}: {}", path.display(), e.to_string());
|
show_info!("{}: {}", path.display(), e.to_string());
|
||||||
all_successful = false;
|
all_successful = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if b.verbose {
|
||||||
|
show_info!("creating directory '{}'", path.display());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if mode::chmod(&path, b.mode()).is_err() {
|
if mode::chmod(&path, b.mode()).is_err() {
|
||||||
all_successful = false;
|
all_successful = false;
|
||||||
}
|
continue;
|
||||||
|
|
||||||
if b.verbose {
|
|
||||||
show_info!("creating directory '{}'", path.display());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if all_successful {
|
if all_successful {
|
||||||
|
|
Loading…
Reference in a new issue