aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar BanceDev 2026-02-28 11:16:46 -0500
committerGravatar BanceDev 2026-02-28 11:16:46 -0500
commitd0e1f621c86c59d118c2e5f83d4bcef8c3ee6159 (patch)
tree44f5186f1df6e3765e3f968a6dd210b855f16017
parentsimplified updating process (diff)
don't send update prompt if no new packages
-rw-r--r--src/action.rs16
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(())