Better output when deleting dupes.

This commit is contained in:
Bill Thiede 2023-02-22 23:22:28 -08:00
parent 80b0412441
commit 031365a5d7

View File

@ -71,12 +71,13 @@ fn main() -> anyhow::Result<()> {
println!("\n{hash}:"); println!("\n{hash}:");
println!(" keep: {}", it.next().unwrap()); println!(" keep: {}", it.next().unwrap());
for p in it { for p in it {
println!(" rm: {p}",);
if std::env::var(ENV_VAR_TO_DELETE).is_ok() { if std::env::var(ENV_VAR_TO_DELETE).is_ok() {
println!("DELETING {p}"); println!(" rm: {p}",);
if let Some(e) = remove_file(p).err() { if let Some(e) = remove_file(p).err() {
eprintln!("Failed to remove {p}: {e}"); eprintln!("Failed to remove {p}: {e}");
} }
} else {
println!("DRYrm: {p}",);
} }
} }
} }