fix: Update remoteProcess.php to handle null values in logItem properties
This commit is contained in:
@@ -371,35 +371,35 @@ function decode_remote_command_output(?ApplicationDeploymentQueue $application_d
|
|||||||
return $i;
|
return $i;
|
||||||
})
|
})
|
||||||
->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) {
|
->reduce(function ($deploymentLogLines, $logItem) use ($seenCommands) {
|
||||||
$command = $logItem['command'];
|
$command = data_get($logItem, 'command');
|
||||||
$isStderr = $logItem['type'] === 'stderr';
|
$isStderr = data_get($logItem, 'type') === 'stderr';
|
||||||
$isNewCommand = ! is_null($command) && ! $seenCommands->first(function ($seenCommand) use ($logItem) {
|
$isNewCommand = ! is_null($command) && ! $seenCommands->first(function ($seenCommand) use ($logItem) {
|
||||||
return $seenCommand['command'] === $logItem['command'] && $seenCommand['batch'] === $logItem['batch'];
|
return data_get($seenCommand, 'command') === data_get($logItem, 'command') && data_get($seenCommand, 'batch') === data_get($logItem, 'batch');
|
||||||
});
|
});
|
||||||
|
|
||||||
if ($isNewCommand) {
|
if ($isNewCommand) {
|
||||||
$deploymentLogLines->push([
|
$deploymentLogLines->push([
|
||||||
'line' => $command,
|
'line' => $command,
|
||||||
'timestamp' => $logItem['timestamp'],
|
'timestamp' => data_get($logItem, 'timestamp'),
|
||||||
'stderr' => $isStderr,
|
'stderr' => $isStderr,
|
||||||
'hidden' => $logItem['hidden'],
|
'hidden' => data_get($logItem, 'hidden'),
|
||||||
'command' => true,
|
'command' => true,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$seenCommands->push([
|
$seenCommands->push([
|
||||||
'command' => $command,
|
'command' => $command,
|
||||||
'batch' => $logItem['batch'],
|
'batch' => data_get($logItem, 'batch'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$lines = explode(PHP_EOL, $logItem['output']);
|
$lines = explode(PHP_EOL, data_get($logItem, 'output'));
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
foreach ($lines as $line) {
|
||||||
$deploymentLogLines->push([
|
$deploymentLogLines->push([
|
||||||
'line' => $line,
|
'line' => $line,
|
||||||
'timestamp' => $logItem['timestamp'],
|
'timestamp' => data_get($logItem, 'timestamp'),
|
||||||
'stderr' => $isStderr,
|
'stderr' => $isStderr,
|
||||||
'hidden' => $logItem['hidden'],
|
'hidden' => data_get($logItem, 'hidden'),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user