Skip to content

Commit

Permalink
Try #3361:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 23, 2022
2 parents a22b50a + 8f28ea4 commit 4460d3a
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions lib/cli/src/commands/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,26 @@ 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());

#[cfg(feature = "debug")]
log::debug!("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()
)
})?;
println!("Running: {cmd:?}");

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

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

Ok(())
}

fn lookup_bindings(&self, registry: &str) -> Result<Vec<Bindings>, Error> {
#[cfg(feature = "debug")]
log::debug!("Querying WAPM for the bindings packages");
println!("Querying WAPM for package bindings");

let mut bindings_to_add = Vec::new();
let language = self.target()?.language();
Expand Down

0 comments on commit 4460d3a

Please sign in to comment.