mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-15 20:47:23 +00:00
report: add extra newline between files of directory output
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
parent
5736fa917c
commit
460c3d1619
@ -134,6 +134,7 @@ fn get_directory_content(path: impl AsRef<Path>) -> String {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let mut out = String::new();
|
let mut out = String::new();
|
||||||
|
let mut first = true;
|
||||||
for entry in read_dir_iter {
|
for entry in read_dir_iter {
|
||||||
let entry = match entry {
|
let entry = match entry {
|
||||||
Ok(entry) => entry,
|
Ok(entry) => entry,
|
||||||
@ -144,7 +145,12 @@ fn get_directory_content(path: impl AsRef<Path>) -> String {
|
|||||||
};
|
};
|
||||||
let path = entry.path();
|
let path = entry.path();
|
||||||
if path.is_file() {
|
if path.is_file() {
|
||||||
let _ = writeln!(out, "{}", get_file_content(path));
|
if first {
|
||||||
|
let _ = writeln!(out, "{}", get_file_content(path));
|
||||||
|
first = false;
|
||||||
|
} else {
|
||||||
|
let _ = writeln!(out, "\n{}", get_file_content(path));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
let _ = writeln!(out, "skipping sub-directory `{}`", path.display());
|
let _ = writeln!(out, "skipping sub-directory `{}`", path.display());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user