Add custom package downloader and extractor

This commit is contained in:
crazywhalecc
2025-06-18 20:55:24 +08:00
parent 8e2dffc3b5
commit f709f3bb18
4 changed files with 61 additions and 4 deletions

View File

@@ -102,6 +102,17 @@ function osfamily2dir(): string
};
}
function osfamily2shortname(): string
{
return match (PHP_OS_FAMILY) {
'Windows', 'WINNT', 'Cygwin' => 'win',
'Darwin' => 'macos',
'Linux' => 'linux',
'BSD' => 'bsd',
default => throw new WrongUsageException('Not support os: ' . PHP_OS_FAMILY),
};
}
function shell(?bool $debug = null): UnixShell
{
/* @noinspection PhpUnhandledExceptionInspection */