Skip to content

Commit

Permalink
Stdout/stderr should be inherited
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Nov 23, 2022
1 parent cab9e01 commit 8f28ea4
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions lib/cli/src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,18 @@ impl Add {
let bindings = self.lookup_bindings(&registry)?;

let mut cmd = self.target()?.command(&bindings)?;
cmd.stdin(Stdio::null())
.stdout(Stdio::inherit())
.stderr(Stdio::inherit());

println!("Running: {cmd:?}");

let status = cmd
.stdin(Stdio::null())
.stdout(Stdio::piped())
.stderr(Stdio::piped())
.status()
.with_context(|| {
format!(
"Unable to start \"{:?}\". Is it installed?",
cmd.get_program()
)
})?;
let status = cmd.status().with_context(|| {
format!(
"Unable to start \"{:?}\". Is it installed?",
cmd.get_program()
)
})?;

anyhow::ensure!(status.success(), "Command failed: {:?}", cmd);

Expand Down

0 comments on commit 8f28ea4

Please sign in to comment.