adjust doctor for os and linux musl check

This commit is contained in:
crazywhalecc
2023-10-30 00:35:58 +08:00
parent 90b2e5568c
commit 2768dc0c40
2 changed files with 6 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace SPC\doctor\item;
use SPC\builder\linux\SystemUtil;
use SPC\builder\traits\UnixSystemUtilTrait;
use SPC\doctor\AsCheckItem;
use SPC\doctor\CheckResult;
@@ -18,6 +19,7 @@ class OSCheckList
if (!in_array(PHP_OS_FAMILY, ['Darwin', 'Linux', 'BSD'])) {
return CheckResult::fail('Current OS is not supported');
}
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . ', supported');
$distro = PHP_OS_FAMILY === 'Linux' ? (' ' . SystemUtil::getOSRelease()['dist']) : '';
return CheckResult::ok(PHP_OS_FAMILY . ' ' . php_uname('m') . $distro . ', supported');
}
}