feat: enhance prerequisite validation to return detailed results

This commit is contained in:
Andras Bacsai
2025-11-21 13:14:48 +01:00
parent 01957f2752
commit 29135e00ba
7 changed files with 95 additions and 21 deletions

View File

@@ -45,9 +45,10 @@ class ValidateServer
throw new \Exception($this->error);
}
$prerequisitesInstalled = $server->validatePrerequisites();
if (! $prerequisitesInstalled) {
$this->error = 'Prerequisites (git, curl, jq) are not installed. Please install them before continuing or use the validation with installation endpoint.';
$validationResult = $server->validatePrerequisites();
if (! $validationResult['success']) {
$missingCommands = implode(', ', $validationResult['missing']);
$this->error = "Prerequisites ({$missingCommands}) are not installed. Please install them before continuing or use the validation with installation endpoint.";
$server->update([
'validation_logs' => $this->error,
]);