From 6bd55fb3166ac2ae77de26870e6795293e9dd73f Mon Sep 17 00:00:00 2001 From: iff Date: Mon, 31 Jul 2023 01:23:45 +0200 Subject: [PATCH] remove: unnecesary code --- src/shell.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/shell.rs b/src/shell.rs index 1ea2936..f70b024 100644 --- a/src/shell.rs +++ b/src/shell.rs @@ -50,15 +50,11 @@ pub fn find_last_command(shell: &str) -> String { } pub fn command_output(shell: &str, command: &str) -> String { - println!("Running command: {}", command); let output = std::process::Command::new(shell) .arg("-c") .arg(command) - .stderr(std::process::Stdio::piped()) - .spawn() - .expect("failed to execute process") - .wait_with_output() - .expect("failed to wait on process"); + .output() + .expect("failed to execute process"); String::from_utf8_lossy(&output.stderr) .to_string()