Skip to content

Commit

Permalink
Ensuring errors are not outputted when they have already been echo'd …
Browse files Browse the repository at this point in the history
…line by line
  • Loading branch information
spamoom committed Jul 27, 2020
1 parent 8b26470 commit 16e81b8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/Helpers/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ public function withCommand(array $arguments)
{
$this->arguments = $arguments;

$this->process = new SymfonyProcess($this->arguments, null, $this->environmentVars, null, $this->timeout);
return $this;
}

public function run()
{
$this->process = new SymfonyProcess($this->arguments, null, $this->environmentVars, null, $this->timeout);
$this->process->start();

if ($this->echoLineByLineOutput) {
Expand All @@ -36,7 +36,8 @@ public function run()
$this->process->wait();

if ($this->process->getExitCode() !== 0) {
if ($this->echoOnFailure) {
// If we're already echo'ing line by line, there's no point echoing it again
if ($this->echoOnFailure && !$this->echoLineByLineOutput) {
foreach ($this->process as $data) {
echo $data;
}
Expand Down

0 comments on commit 16e81b8

Please sign in to comment.