Skip to content

Commit

Permalink
feat: detect upgrading is failed or not
Browse files Browse the repository at this point in the history
  • Loading branch information
Young-TW committed Nov 3, 2024
1 parent 2cc8038 commit e4ab036
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/command/autoremove.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
use crate::root::get_sudo;

pub fn autoremove(manager: String, slient: bool, verbose: bool) {
if !slient {
println!("yu: Auto removing unused packages")
}
}
6 changes: 4 additions & 2 deletions src/command/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ pub fn upgrade(manager: String, silent: bool, verbose: bool) {
.spawn()
.expect("Failed to execute upgrade command");

upgrade_cmd.wait().expect("Upgrade command wasn't running");
let upgrade_result = upgrade_cmd.wait().expect("Upgrade command wasn't running");

if !silent {
if !upgrade_result.success() {
println!("yu: Failed to upgrade system");
} else if !silent {
println!("yu: System upgraded");
}
}
Expand Down

0 comments on commit e4ab036

Please sign in to comment.