diff options
| -rw-r--r-- | src/action.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/action.rs b/src/action.rs index f404494..dacf289 100644 --- a/src/action.rs +++ b/src/action.rs @@ -129,13 +129,17 @@ fn update() -> Result<(), String> { } } - util::print_collected_packages(&update_pkgs, "Packages to update"); - if util::yn_prompt("Proceed with update?") { - for (name, path, cfg_path) in update_pkgs { - config::run_config_command(&cfg_path, &path, ConfigCommand::Build)?; - config::run_config_command(&cfg_path, &path, ConfigCommand::Install)?; - println!("Upgraded {}", name); + if !update_pkgs.is_empty() { + util::print_collected_packages(&update_pkgs, "Packages to update"); + if util::yn_prompt("Proceed with update?") { + for (name, path, cfg_path) in update_pkgs { + config::run_config_command(&cfg_path, &path, ConfigCommand::Build)?; + config::run_config_command(&cfg_path, &path, ConfigCommand::Install)?; + println!("Upgraded {}", name); + } } + } else { + println!("No packages to update."); } Ok(()) |
