Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/stdx/src/process.rs')
| -rw-r--r-- | crates/stdx/src/process.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/stdx/src/process.rs b/crates/stdx/src/process.rs index bca0cbc36d..e6935f06b2 100644 --- a/crates/stdx/src/process.rs +++ b/crates/stdx/src/process.rs @@ -15,6 +15,7 @@ pub fn streaming_output( err: ChildStderr, on_stdout_line: &mut dyn FnMut(&str), on_stderr_line: &mut dyn FnMut(&str), + on_eof: &mut dyn FnMut(), ) -> io::Result<(Vec<u8>, Vec<u8>)> { let mut stdout = Vec::new(); let mut stderr = Vec::new(); @@ -44,6 +45,9 @@ pub fn streaming_output( on_stderr_line(line); } } + if eof { + on_eof(); + } } })?; @@ -63,6 +67,7 @@ pub fn spawn_with_streaming_output( child.stderr.take().unwrap(), on_stdout_line, on_stderr_line, + &mut || (), )?; let status = child.wait()?; Ok(Output { status, stdout, stderr }) |