Skip to content

Commit

Permalink
Merge pull request #19 from amazeeio/symfony6-update
Browse files Browse the repository at this point in the history
fix: wrap mustRun to catch errors
  • Loading branch information
tobybellwood authored Aug 14, 2023
2 parents 1822c42 + 0cc3076 commit 18aaa97
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/LagoonCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function getJwtToken() {
$args += ["-i", $this->sshKey];
}

$cmd = ["ssh", ...$args, "lagoon@$ssh_host", "token", "2>&1"];
$cmd = ["ssh", ...$args, "lagoon@$ssh_host", "token"];

$this->logger()->debug("Retrieving token via SSH -" . implode(" ", $cmd));
if (version_compare(Kernel::VERSION, "4.2", "<")) {
Expand All @@ -209,7 +209,12 @@ public function getJwtToken() {
}

$ssh->setTimeout($this->sshTimeout);
$ssh->mustRun();

try {
$ssh->mustRun();
} catch (ProcessFailedException $exception) {
$this->logger->debug($ssh->getMessage());
}

$token = trim($ssh->getOutput());
$this->logger->debug("JWT Token loaded via ssh: " . $token);
Expand Down

0 comments on commit 18aaa97

Please sign in to comment.