diff --git a/cargo-near/src/commands/new/mod.rs b/cargo-near/src/commands/new/mod.rs index c0da2f26..c0c06fb4 100644 --- a/cargo-near/src/commands/new/mod.rs +++ b/cargo-near/src/commands/new/mod.rs @@ -96,17 +96,28 @@ impl NewContext { )); } - let status = std::process::Command::new("git") + // let status = std::process::Command::new("git") + let child = std::process::Command::new("git") .arg("commit") .arg("-m") .arg("init") .current_dir(project_dir) - .stdout(Stdio::null()) - .stderr(Stdio::null()) - .status()?; - if !status.success() { + .stdout(Stdio::piped()) + .stderr(Stdio::piped()) + // .stdout(Stdio::null()) + // .stderr(Stdio::null()) + // .status()?; + .spawn()?; + // if !status.success() { + // return Err(color_eyre::eyre::eyre!( + // "Failed to execute process: `git commit -m init`" + // )); + // } + let output = child.wait_with_output()?; + if !output.status.success() { + println!("{}", String::from_utf8_lossy(&output.stderr)); return Err(color_eyre::eyre::eyre!( - "Failed to execute process: `git commit -m init`" + "Failed to execute process: `cargo update`" )); }