Fix for issue with CommandExecutor when using InputLocation::StdIn (issue #1306) (#1308)

Co-authored-by: dan <dan@localhost.localdomain>
This commit is contained in:
Daniel Blackwell 2023-06-08 15:25:20 +01:00 committed by GitHub
parent 7d67fc77b5
commit fa63493cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -132,8 +132,7 @@ impl CommandConfigurator for StdCommandConfigurator {
Ok(cmd.spawn()?)
}
InputLocation::StdIn => {
self.command.stdin(Stdio::piped()).spawn()?;
let mut handle = self.command.spawn()?;
let mut handle = self.command.stdin(Stdio::piped()).spawn()?;
let mut stdin = handle.stdin.take().unwrap();
if let Err(err) = stdin.write_all(input.target_bytes().as_slice()) {
if err.kind() != std::io::ErrorKind::BrokenPipe {