mirror of
https://github.com/lune-org/lune.git
synced 2025-04-19 19:34:02 +01:00
refactor: remove usage of async writing to child stdin
Co-authored-by: Filip Tibell <filip.tibell@gmail.com>
This commit is contained in:
parent
6f9a9efa21
commit
a480c1dc8e
1 changed files with 4 additions and 9 deletions
|
@ -220,15 +220,10 @@ async fn spawn_command(
|
||||||
// If the stdin option was provided, we write that to the child
|
// If the stdin option was provided, we write that to the child
|
||||||
if let Some(stdin) = stdin {
|
if let Some(stdin) = stdin {
|
||||||
let mut child_stdin = child.stdin.take().unwrap();
|
let mut child_stdin = child.stdin.take().unwrap();
|
||||||
|
child_stdin
|
||||||
let _ = task::spawn(async move {
|
.write_all(stdin.as_bytes())
|
||||||
let mut tee = AsyncTeeWriter::new(&mut child_stdin);
|
|
||||||
tee.write_all(stdin.as_bytes()).await.into_lua_err()?;
|
|
||||||
|
|
||||||
Ok::<(), LuaError>(())
|
|
||||||
})
|
|
||||||
.await
|
.await
|
||||||
.expect("Tee writer for stdin errored");
|
.into_lua_err()?;
|
||||||
}
|
}
|
||||||
|
|
||||||
if inherit_stdio {
|
if inherit_stdio {
|
||||||
|
|
Loading…
Add table
Reference in a new issue