Skip to content

Commit b847c18

Browse files
authored
Update utils.rs
1 parent 4fb5e3a commit b847c18

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/utils.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use colored::*;
2-
use std::process::Command;
2+
use std::process::{Command, Stdio};
33
use std::io::{self, Write};
44
use std::thread;
55
use std::time::Duration;
@@ -24,10 +24,14 @@ pub fn run_command_with_spinner(program: &str, args: Vec<&str>, message: &str) {
2424
let _ = io::stdout().flush();
2525
});
2626

27-
let output = Command::new(program)
28-
.args(&args)
29-
.output()
30-
.expect(&format!("Failed to execute {}", program));
27+
let child = Command::new(program)
28+
.args(&args)
29+
.stdout(Stdio::piped())
30+
.stderr(Stdio::piped())
31+
.spawn()
32+
.expect(&format!("Failed to execute {}", program));
33+
34+
let output = child.wait_with_output().expect("Failed to wait on child");
3135

3236
stop.store(true, Ordering::Relaxed);
3337
handle.join().unwrap();

0 commit comments

Comments
 (0)