Skip to content

Commit

Permalink
Improve process configuration (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
smortexa authored Sep 1, 2022
1 parent 7eb5908 commit e399e13
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/Console/TestArchitecture.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ public function handle(): int
$command .= ' --stop-on-failure';
}

Process::fromShellCommandline($command)
->run(function ($type, $line) {
return match ($type) {
'err' => $this->line($line),
default => $this->info($line)
};
});
$process = Process::fromShellCommandline($command);
$process->setTimeout(60);
$process->setTty(Process::isTtySupported());
$process->run(function ($type, $line) use (&$process) {
match ($type) {
$process::ERR => $this->line($line),
default => $this->info($line)
};
});

return static::SUCCESS;
}
Expand Down

0 comments on commit e399e13

Please sign in to comment.