mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
fix: use command's STDOUT
This commit is contained in:
parent
1f15d92f72
commit
54b81e0e0f
2 changed files with 32 additions and 13 deletions
|
|
@ -50,11 +50,15 @@ 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)
|
||||
.output()
|
||||
.expect("failed to execute process");
|
||||
.stderr(std::process::Stdio::piped())
|
||||
.spawn()
|
||||
.expect("failed to execute process")
|
||||
.wait_with_output()
|
||||
.expect("failed to wait on process");
|
||||
|
||||
String::from_utf8_lossy(&output.stderr)
|
||||
.to_string()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue