mirror of
https://github.com/lune-org/lune.git
synced 2025-04-19 11:23:57 +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 let Some(stdin) = stdin {
|
||||
let mut child_stdin = child.stdin.take().unwrap();
|
||||
|
||||
let _ = task::spawn(async move {
|
||||
let mut tee = AsyncTeeWriter::new(&mut child_stdin);
|
||||
tee.write_all(stdin.as_bytes()).await.into_lua_err()?;
|
||||
|
||||
Ok::<(), LuaError>(())
|
||||
})
|
||||
.await
|
||||
.expect("Tee writer for stdin errored");
|
||||
child_stdin
|
||||
.write_all(stdin.as_bytes())
|
||||
.await
|
||||
.into_lua_err()?;
|
||||
}
|
||||
|
||||
if inherit_stdio {
|
||||
|
|
Loading…
Add table
Reference in a new issue