Skip to content

Commit d00542a

Browse files
authored
Merge pull request #15 from fthues/fix/deploy-response-string-access
Fix: deploy command crashes on API response string access
2 parents 71af719 + fbb1061 commit d00542a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

app/Commands/DeployCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ protected function deploy($serverId, $siteId, $domain, $data, $isScheduled = fal
9999
exit();
100100
}
101101

102-
$this->info(Arr::first($deploying['data'])['message']);
102+
$firstValue = Arr::first($deploying['data']);
103+
$this->info(is_array($firstValue) ? $firstValue['message'] : $firstValue);
103104

104105
if ($isScheduled) {
105106
return;
@@ -186,7 +187,7 @@ private function getLatestDeploymentId(int $serverId, int $siteId): ?int
186187
try {
187188
$deployment = $poller->getLatestDeployment($serverId, $siteId);
188189

189-
return $deployment['id'] ?? null;
190+
return isset($deployment['id']) ? (int) $deployment['id'] : null;
190191
} catch (Exception $e) {
191192
$this->error('Failed to get latest deployment: '.$e->getMessage());
192193

0 commit comments

Comments
 (0)