mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 14:30:10 +01:00
fix?: remove fd clone
This commit is contained in:
parent
5f86ff02a2
commit
3321cfa240
1 changed files with 2 additions and 34 deletions
|
|
@ -313,14 +313,12 @@ pub fn confirm_suggestion(shell: &str, command: &str, highlighted: &str) -> Resu
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn run_suggestion_p(shell: &str, p: &str, command: &str) -> std::process::ExitStatus {
|
||||
use std::os::fd::AsFd;
|
||||
std::process::Command::new(p)
|
||||
.arg(shell)
|
||||
.arg("-c")
|
||||
.arg(command)
|
||||
.stdout(stderr().as_fd().try_clone_to_owned().unwrap())
|
||||
.stdout(stderr())
|
||||
.stderr(Stdio::inherit())
|
||||
.spawn()
|
||||
.expect("failed to execute process")
|
||||
|
|
@ -328,14 +326,12 @@ fn run_suggestion_p(shell: &str, p: &str, command: &str) -> std::process::ExitSt
|
|||
.unwrap()
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn run_suggestion(shell: &str, command: &str) -> std::process::ExitStatus {
|
||||
use std::os::fd::AsFd;
|
||||
std::process::Command::new(shell)
|
||||
.arg("-c")
|
||||
.arg(command)
|
||||
// .stdout(Stdio::inherit())
|
||||
.stdout(stderr().as_fd().try_clone_to_owned().unwrap())
|
||||
.stdout(stderr())
|
||||
.stderr(Stdio::inherit())
|
||||
.spawn()
|
||||
.expect("failed to execute process")
|
||||
|
|
@ -343,31 +339,3 @@ fn run_suggestion(shell: &str, command: &str) -> std::process::ExitStatus {
|
|||
.unwrap()
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn run_suggestion_p(shell: &str, p: &str, command: &str) -> std::process::ExitStatus {
|
||||
use std::os::windows::io::AsHandle;
|
||||
std::process::Command::new(p)
|
||||
.arg(shell)
|
||||
.arg("-c")
|
||||
.arg(command)
|
||||
.stdout(stderr().as_handle().try_clone_to_owned().unwrap())
|
||||
.stderr(Stdio::inherit())
|
||||
.spawn()
|
||||
.expect("failed to execute process")
|
||||
.wait()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
fn run_suggestion(shell: &str, command: &str) -> std::process::ExitStatus {
|
||||
use std::os::windows::io::AsHandle;
|
||||
std::process::Command::new(shell)
|
||||
.arg("-c")
|
||||
.arg(command)
|
||||
.stdout(stderr().as_handle().try_clone_to_owned().unwrap())
|
||||
.stderr(Stdio::inherit())
|
||||
.spawn()
|
||||
.expect("failed to execute process")
|
||||
.wait()
|
||||
.unwrap()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue