Skip to content

Commit

Permalink
fix: output errors when install fails (#21)
Browse files Browse the repository at this point in the history
Co-authored-by: Danny Browning <[email protected]>
  • Loading branch information
dbcfd and Danny Browning authored Oct 3, 2023
1 parent c110b3b commit b85478b
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cli/src/install/npm.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use spinners::{Spinner, Spinners};
use std::io::BufRead;
use std::path::Path;
use tokio::process::Command;

Expand Down Expand Up @@ -45,7 +46,20 @@ pub async fn npm_install(
.output()
.await?;
if !out.status.success() {
anyhow::bail!("Failed to install app template dependencies");
log::error!("Failed to install");
let b = std::io::BufReader::new(std::io::Cursor::new(out.stdout));
for l in b.lines() {
if let Ok(l) = l {
log::error!("{l}");
}
}
let b = std::io::BufReader::new(std::io::Cursor::new(out.stderr));
for l in b.lines() {
if let Ok(l) = l {
log::error!("err: {l}");
}
}
anyhow::bail!("Failed to install, please see output");
}
s.stop_with_newline();
Ok(())
Expand Down

0 comments on commit b85478b

Please sign in to comment.