Waits for the process to finish. Returns an error if the process has finished with non-zero exit code. You should use this method for processes spawned via [`Cmd::spawn()`] since the output of the command won't be read and returned, but just written to this process's `stdout` (as `stdout` is inherited with [`Cmd::spawn()`])
(&mut self)
| 536 | /// but just written to this process's `stdout` (as `stdout` is inherited |
| 537 | /// with [`Cmd::spawn()`]) |
| 538 | pub fn wait(&mut self) -> Result<()> { |
| 539 | let exit_status = self.child.wait().proc_context(self)?; |
| 540 | |
| 541 | if !exit_status.success() { |
| 542 | return Err(Error::proc( |
| 543 | &self, |
| 544 | &format_args!("Non-zero exit code: {}", exit_status), |
| 545 | )); |
| 546 | } |
| 547 | Ok(()) |
| 548 | } |
| 549 | |
| 550 | /// Same as [`Child::read()`] but reads any bytes sequence from the |
| 551 | /// child process `stdout`. |
no test coverage detected