From e4894ac8b49c9c550a899d008740a468d384bb7c Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Wed, 7 Feb 2024 02:18:02 -0500 Subject: [PATCH] chore(cli): use spawn to display `emcc`'s stdout and stderr Co-authored-by: Nbiba Bedis --- cli/loader/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index 00bf39ac..c2d5bcc9 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -677,12 +677,12 @@ impl Loader { } command.arg("parser.c"); - let output = command.output().context("Failed to run emcc command")?; - if !output.status.success() { - return Err(anyhow!( - "emcc command failed - {}", - String::from_utf8_lossy(&output.stderr) - )); + let status = command + .spawn() + .with_context(|| "Failed to run emcc command")? + .wait()?; + if !status.success() { + return Err(anyhow!("emcc command failed")); } fs::rename(src_path.join(output_name), output_path)