(command: &str, output: Output)
| 60 | } |
| 61 | |
| 62 | fn bail_with_output(command: &str, output: Output) -> anyhow::Result<Output> { |
| 63 | let stderr = String::from_utf8_lossy(&output.stderr).trim().to_owned(); |
| 64 | let stdout = String::from_utf8_lossy(&output.stdout).trim().to_owned(); |
| 65 | bail!( |
| 66 | "{command} failed: {}", |
| 67 | if !stderr.is_empty() { |
| 68 | stderr |
| 69 | } else if !stdout.is_empty() { |
| 70 | stdout |
| 71 | } else { |
| 72 | format!("exit status {}", output.status) |
| 73 | } |
| 74 | ); |
| 75 | } |
| 76 | |
| 77 | fn print_status(action: &str) { |
| 78 | println!( |
no outgoing calls
no test coverage detected