Refactor Linux and macOS tool checks for improved error handling and command execution (#1025)

This commit is contained in:
Jerry Ma
2026-02-06 21:17:19 +08:00
committed by GitHub
parent 041b08f10f
commit 82bf317911
4 changed files with 15 additions and 9 deletions

View File

@@ -53,7 +53,7 @@ class MacOSToolCheck
}
}
if (!empty($missing)) {
return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', [$missing]);
return CheckResult::fail('missing system commands: ' . implode(', ', $missing), 'build-tools', ['missing' => $missing]);
}
return CheckResult::ok();
}
@@ -63,7 +63,7 @@ class MacOSToolCheck
{
// if the bison command is /usr/bin/bison, it is the system bison that may be too old
if (($bison = MacOSUtil::findCommand('bison', $command_path)) === null) {
return CheckResult::fail('bison is not installed or too old', 'build-tools', [['bison']]);
return CheckResult::fail('bison is not installed or too old', 'build-tools', ['missing' => ['bison']]);
}
// check version: bison (GNU Bison) x.y(.z)
$version = shell()->execWithResult("{$bison} --version", false);