Fix artifact downloader constants and improve error message for hosted package-bin

This commit is contained in:
crazywhalecc 2025-12-05 14:44:27 +08:00 committed by Jerry Ma
parent 7fa6fd08d4
commit 93a697ebbf
2 changed files with 4 additions and 2 deletions

View File

@ -36,12 +36,14 @@ use ZM\Logger\ConsoleColor;
*/ */
class ArtifactDownloader class ArtifactDownloader
{ {
/** @var array<string, class-string<DownloadTypeInterface>> */
public const array DOWNLOADERS = [ public const array DOWNLOADERS = [
'bitbuckettag' => BitBucketTag::class, 'bitbuckettag' => BitBucketTag::class,
'filelist' => FileList::class, 'filelist' => FileList::class,
'git' => Git::class, 'git' => Git::class,
'ghrel' => GitHubRelease::class, 'ghrel' => GitHubRelease::class,
'ghtar', 'ghtagtar' => GitHubTarball::class, 'ghtar' => GitHubTarball::class,
'ghtagtar' => GitHubTarball::class,
'local' => LocalDir::class, 'local' => LocalDir::class,
'pie' => PIE::class, 'pie' => PIE::class,
'url' => Url::class, 'url' => Url::class,

View File

@ -58,6 +58,6 @@ class HostedPackageBin implements DownloadTypeInterface
return DownloadResult::archive($filename, $config, extract: $config['extract'] ?? null, version: $version); return DownloadResult::archive($filename, $config, extract: $config['extract'] ?? null, version: $version);
} }
} }
throw new DownloaderException("No matching asset found for hosted package-bin {$name} with criteria: {$find_str}"); throw new DownloaderException("No matching asset found for hosted package-bin {$name}: {$find_str}");
} }
} }