From 0cf709bc901cd18fbf7c358873364117ced80a01 Mon Sep 17 00:00:00 2001 From: Michal Date: Sat, 23 Jul 2022 16:22:42 +0100 Subject: [PATCH] Added check to prune --- src/operations/prune.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/operations/prune.rs b/src/operations/prune.rs index c86a2bc..1749e51 100644 --- a/src/operations/prune.rs +++ b/src/operations/prune.rs @@ -109,8 +109,12 @@ pub fn prune(verbose: bool) { log!(verbose, "Current dir: {:?}", env::current_dir().unwrap()); // Print which packages were deleted - info!("Deleted the following packages:"); - for p in packages_to_delete.iter_mut() { - info!("{}-{}", p.name.replace("./", ""), p.ver); + if !packages_to_delete.is_empty() { + info!("Deleted the following packages:"); + for p in packages_to_delete.iter_mut() { + info!("{}-{}", p.name.replace("./", ""), p.ver); + } + } else { + info!("No packages were deleted."); } }