From f8035357b702919e05818ae99f4121db1ad7c831 Mon Sep 17 00:00:00 2001 From: kjuulh Date: Sun, 25 Jun 2023 13:43:42 +0200 Subject: [PATCH] feat: with direct output Signed-off-by: kjuulh --- cuddle_cli/src/actions/shell.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/cuddle_cli/src/actions/shell.rs b/cuddle_cli/src/actions/shell.rs index 226c948..9a4f660 100644 --- a/cuddle_cli/src/actions/shell.rs +++ b/cuddle_cli/src/actions/shell.rs @@ -29,10 +29,8 @@ impl ShellAction { let current_dir = current_dir()?; log::trace!("current executable dir={}", current_dir.to_string_lossy()); - let mut process = Command::new(path.clone()) + let mut process = Command::new(&path) .current_dir(current_dir) - .stdout(Stdio::piped()) - .stderr(Stdio::piped()) .envs(variables.iter().map(|v| { log::trace!("{:?}", v); @@ -40,20 +38,6 @@ impl ShellAction { })) .spawn()?; - if let Some(ref mut stdout) = process.stdout { - for line in BufReader::new(stdout).lines() { - let line = line.unwrap(); - println!("[{}] {}", self.name, line); - } - } - - if let Some(ref mut stderr) = process.stderr { - for line in BufReader::new(stderr).lines() { - let line = line.unwrap(); - println!("[{}] {}", self.name, line); - } - } - let status = process.wait()?; match status.code() {