Send a notification at the end of the run (fix #554)

This commit is contained in:
Roey Darwish Dror
2020-11-04 11:31:09 +02:00
parent 2e0275b816
commit 35c47a529d
2 changed files with 13 additions and 1 deletions

View File

@@ -381,7 +381,15 @@ fn run() -> Result<()> {
}
}
if post_command_failed || runner.report().data().iter().any(|(_, result)| result.failed()) {
let failed = post_command_failed || runner.report().data().iter().any(|(_, result)| result.failed());
terminal::notify_desktop(
format!(
"Topgrade finished {}",
if failed { "with errors" } else { "sucessfully" }
),
None,
);
if failed {
Err(StepFailed.into())
} else {
Ok(())