mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 12:54:52 +08:00
add detection for ghrel prerelease
This commit is contained in:
parent
dbb566ac7c
commit
e0e3bc6d97
@ -99,12 +99,18 @@ class Downloader
|
|||||||
hooks: [[CurlHook::class, 'setupGithubToken']],
|
hooks: [[CurlHook::class, 'setupGithubToken']],
|
||||||
), true);
|
), true);
|
||||||
$url = null;
|
$url = null;
|
||||||
foreach ($data[0]['assets'] as $asset) {
|
foreach ($data as $release) {
|
||||||
if (preg_match('|' . $source['match'] . '|', $asset['name'])) {
|
if ($release['prerelease'] === true) {
|
||||||
$url = $asset['browser_download_url'];
|
continue;
|
||||||
break;
|
}
|
||||||
|
foreach ($release['assets'] as $asset) {
|
||||||
|
if (preg_match('|' . $source['match'] . '|', $asset['name'])) {
|
||||||
|
$url = $asset['browser_download_url'];
|
||||||
|
break 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$url) {
|
if (!$url) {
|
||||||
throw new DownloaderException("failed to find {$name} source");
|
throw new DownloaderException("failed to find {$name} source");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user