From eae9921798a3dc876b8897b33dc3f82757e0f110 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Sat, 18 Sep 2021 18:09:11 +0000 Subject: [PATCH] feat: print command and status on failure --- --- a/src/command.rs +++ b/src/command.rs @@ -21,9 +21,10 @@ } fn run(&mut self) -> Result<()> { + self.inherit_stdio(); let out = self.output()?; if !out.status.success() { - anyhow::bail!("command failed with status {}", out.status); + anyhow::bail!("command ({:?}) failed with status {}", self, out.status); } Ok(()) } @@ -34,9 +35,10 @@ } fn run_string(&mut self) -> Result { + self.inherit_stdio(); let out = self.output()?; if !out.status.success() { - anyhow::bail!("command failed"); + anyhow::bail!("command ({:?}) failed with status {}", self, out.status); } Ok(String::from_utf8(out.stdout)?) } -- gitstuff