mirror of
https://ghfast.top/https://github.com/StarCitizenToolBox/app.git
synced 2025-06-28 09:04:45 +08:00
feat: unp4kc
This commit is contained in:
@ -21,4 +21,4 @@ hickory-resolver = { version = "0.24" }
|
||||
anyhow = "1.0"
|
||||
win32job = "2"
|
||||
lazy_static = "1.4"
|
||||
scopeguard = "1.2"
|
||||
scopeguard = "1.2"
|
@ -1,7 +1,8 @@
|
||||
use std::sync::Arc;
|
||||
use tokio::io::{AsyncBufReadExt, BufReader};
|
||||
use crate::frb_generated::StreamSink;
|
||||
|
||||
use tokio::io::{AsyncBufReadExt, BufReader};
|
||||
|
||||
use crate::frb_generated::StreamSink;
|
||||
|
||||
pub async fn start_process(
|
||||
executable: String,
|
||||
@ -37,12 +38,16 @@ pub async fn start_process(
|
||||
}
|
||||
let stdout = child.stdout.take().expect("Failed to open stdout");
|
||||
let stderr = child.stderr.take().expect("Failed to open stderr");
|
||||
// let stdin = child.stdin.take().expect("Failed to open stderr");
|
||||
|
||||
let output_task = tokio::spawn(process_output(stdout, stream_sink_arc.clone()));
|
||||
let error_task = tokio::spawn(process_error(stderr, stream_sink_arc.clone()));
|
||||
// let input_task = tokio::spawn(process_input(stdin));
|
||||
|
||||
tokio::select! {
|
||||
_ = output_task => (),
|
||||
_ = error_task => (),
|
||||
// _ = input_task => (),
|
||||
}
|
||||
|
||||
let exit_status = child.wait().await.expect("Failed to wait for child process");
|
||||
@ -82,5 +87,4 @@ async fn process_error<R>(stderr: R, stream_sink: Arc<StreamSink<String>>)
|
||||
println!("{}", line.trim());
|
||||
stream_sink.add("error:".to_string() + &*line.trim().to_string()).unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user