feat: flag and config to skip notifications by jlucktay (#5)
* feat: flag and config to skip notifications At the end of a run, topgrade normally sends a system notification. This change adds a command-line flag and a config-file option to disable this behaviour. * fix: clippy issues Also derive Eq where PartialEq is being derived. https://rust-lang.github.io/rust-clippy/master/index.html#derive_partial_eq_without_eq Authored-by: James Lucktaylor <jlucktay+github@gmail.com> Approved-by: Thomas Schönauer <t.schoenauer@hgs-wt.at>
This commit is contained in:
18
src/main.rs
18
src/main.rs
@@ -466,13 +466,17 @@ fn run() -> Result<()> {
|
||||
}
|
||||
|
||||
let failed = post_command_failed || runner.report().data().iter().any(|(_, result)| result.failed());
|
||||
terminal::notify_desktop(
|
||||
format!(
|
||||
"Topgrade finished {}",
|
||||
if failed { "with errors" } else { "successfully" }
|
||||
),
|
||||
None,
|
||||
);
|
||||
|
||||
if !config.skip_notify() {
|
||||
terminal::notify_desktop(
|
||||
format!(
|
||||
"Topgrade finished {}",
|
||||
if failed { "with errors" } else { "successfully" }
|
||||
),
|
||||
None,
|
||||
);
|
||||
}
|
||||
|
||||
if failed {
|
||||
Err(StepFailed.into())
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user