failed to execute: show errors better

This commit is contained in:
Igor Katson 2024-08-12 20:59:21 +01:00
parent 6a185a7805
commit 2b1601ee85
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
2 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,4 @@
use anyhow::Context;
use std::path::Path;
use std::process::Command;
@ -19,14 +20,15 @@ fn main() {
.args(args)
.current_dir(webui_dir)
.output()
.unwrap_or_else(|_| {
panic!(
.with_context(|| {
format!(
"Failed to execute {} {} in {:?}",
cmd,
args.join(" "),
webui_dir
)
});
})
.unwrap();
if !output.status.success() {
panic!(