Skip to content

Commit e074154

Browse files
committed
Don't exit loop until an exit code is returned
1 parent 190b97c commit e074154

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/ProcessManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* @package kamermans\Command
99
*/
1010
class ProcessManager {
11-
11+
1212
protected $cmd;
1313
protected $buffers;
1414
protected $handle;
@@ -74,7 +74,7 @@ public function exec($callback, $callbacklines, $buffer_size, $cwd, $env, $conf)
7474
}
7575

7676
$finished_handles = count(array_filter($this->io_reads, 'feof'));
77-
if ($finished_handles === count($this->io_reads)) {
77+
if ($exit_code !== null && $finished_handles === count($this->io_reads)) {
7878
break;
7979
}
8080

@@ -243,8 +243,8 @@ protected function setupStreams($callback, $callbacklines, $buffer_size)
243243
} else if ($this->isStdInStreaming()) {
244244
// STDIN is streaming to the process
245245
$stdin_stream = new Stream\StreamWriter(
246-
$this->buffers[Command::STDIN],
247-
$this->io_handles[Command::STDIN],
246+
$this->buffers[Command::STDIN],
247+
$this->io_handles[Command::STDIN],
248248
$buffer_size
249249
);
250250
} else {

0 commit comments

Comments
 (0)