Suggestions

This commit is contained in:
crazywhalecc
2025-06-29 16:00:17 +08:00
parent 0598eff9c5
commit 977fbaa8ef
30 changed files with 196 additions and 215 deletions

View File

@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace SPC\command;
use SPC\builder\linux\SystemUtil;
use SPC\builder\traits\UnixSystemUtilTrait;
use SPC\exception\DownloaderException;
use SPC\exception\FileSystemException;
@@ -224,12 +223,8 @@ class DownloadCommand extends BaseCommand
'{name}' => $source,
'{arch}' => arch2gnu(php_uname('m')),
'{os}' => strtolower(PHP_OS_FAMILY),
'{libc}' => match (getenv('SPC_TARGET')) {
SPCTarget::MUSL_STATIC, SPCTarget::MUSL => 'musl',
SPCTarget::GLIBC => 'glibc',
default => 'default',
},
'{libcver}' => PHP_OS_FAMILY === 'Linux' ? (SystemUtil::getLibcVersionIfExists() ?? 'default') : 'default',
'{libc}' => SPCTarget::getLibc() ?? 'default',
'{libcver}' => SPCTarget::getLibcVersion() ?? 'default',
];
$find = str_replace(array_keys($replace), array_values($replace), Config::getPreBuilt('match-pattern'));
// find filename in asset list