Fix "WSL already reported" panic (#1344)

This commit is contained in:
Andre Toerien
2025-09-28 08:25:10 +02:00
committed by GitHub
parent fec08a5ad1
commit 7c7e7c3ce4
5 changed files with 59 additions and 77 deletions

View File

@@ -38,7 +38,6 @@ mod ctrlc;
mod error;
mod execution_context;
mod executor;
mod report;
mod runner;
#[cfg(windows)]
mod self_renamer;
@@ -200,26 +199,32 @@ fn run() -> Result<()> {
step.run(&mut runner, &ctx)?
}
if !runner.report().data().is_empty() {
let mut failed = false;
let report = runner.report();
if !report.is_empty() {
print_separator(t!("Summary"));
for (key, result) in runner.report().data() {
print_result(key, result);
}
#[cfg(target_os = "linux")]
{
if let Ok(distribution) = &distribution {
distribution.show_summary();
for (key, result) in report {
if !failed && result.failed() {
failed = true;
}
print_result(key, result);
}
}
#[cfg(target_os = "linux")]
{
if let Ok(distribution) = &distribution {
distribution.show_summary();
}
}
let mut post_command_failed = false;
if let Some(commands) = config.post_commands() {
for (name, command) in commands {
if generic::run_custom_command(name, command, &ctx).is_err() {
post_command_failed = true;
let result = generic::run_custom_command(name, command, &ctx);
if !failed && result.is_err() {
failed = true;
}
}
}
@@ -244,8 +249,6 @@ fn run() -> Result<()> {
}
}
let failed = post_command_failed || runner.report().data().iter().any(|(_, result)| result.failed());
if !config.skip_notify() {
notify_desktop(
if failed {