(&mut self, name: &str, ext: &str, mut cmd: diva::Command)
| 67 | } |
| 68 | |
| 69 | pub fn add_cmd(&mut self, name: &str, ext: &str, mut cmd: diva::Command) { |
| 70 | self.add(name, |zipper| { |
| 71 | let output = cmd.run_and_wait_for_output()?; |
| 72 | zipper.write_file(format!("{name}-stdout.{ext}"), output.stdout())?; |
| 73 | zipper.write_file(format!("{name}-stderr.txt"), output.stderr())?; |
| 74 | if !output.success() |
| 75 | && let Some(code) = output.status().code() |
| 76 | { |
| 77 | zipper.write_file(format!("{name}-status.txt"), &code.to_le_bytes())?; |
| 78 | } |
| 79 | Ok(()) |
| 80 | }); |
| 81 | } |
| 82 | |
| 83 | pub fn finish(self) -> anyhow::Result<Utf8PathBuf> { |
| 84 | self.zipper.finish() |
no test coverage detected