Skip to content

Commit

Permalink
Use commands var
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonvarga committed Jan 25, 2018
1 parent 1948823 commit b6b7cf0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addons/Spock/SpockListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,25 @@ public function run($data)

$this->data = $data;

$process = new Process($this->commands(), BASE);
$process = new Process($commands = $this->commands(), BASE);

// Log any exceptions when attempting to run the commands
try {
$process->run();
} catch (\Exception $e) {
\Log::error('Spock command hit an exception: ' . $this->commands());
\Log::error('Spock command hit an exception: ' . $commands);
\Log::error($e->getMessage());
}

// If the process did not exit successfully log the details
if ($process->getExitCode() != 0) {
\Log::error("Spock command exited unsuccessfully: ". PHP_EOL .
$this->commands() . PHP_EOL .
\Log::error(
"Spock command exited unsuccessfully: ". PHP_EOL .
$commands . PHP_EOL .
$process->getErrorOutput() . PHP_EOL .
$process->getOutput()
);
}

}

/**
Expand Down

0 comments on commit b6b7cf0

Please sign in to comment.