mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 21:04:52 +08:00
catch exception when license path key is not set, fix libxslt license
This commit is contained in:
parent
ce60a9c804
commit
2e3544f296
@ -270,7 +270,7 @@
|
|||||||
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
"regex": "/href=\"(?<file>libxslt-(?<version>[^\"]+)\\.tar\\.xz)\"/",
|
||||||
"license": {
|
"license": {
|
||||||
"type": "file",
|
"type": "file",
|
||||||
"text": "COPYING"
|
"path": "COPYING"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libyaml": {
|
"libyaml": {
|
||||||
|
|||||||
@ -102,8 +102,11 @@ class LicenseDumper
|
|||||||
/**
|
/**
|
||||||
* @throws RuntimeException
|
* @throws RuntimeException
|
||||||
*/
|
*/
|
||||||
private function loadSourceFile(string $source_name, string $in_path, ?string $custom_base_path = null): string
|
private function loadSourceFile(string $source_name, ?string $in_path, ?string $custom_base_path = null): string
|
||||||
{
|
{
|
||||||
|
if (is_null($in_path)) {
|
||||||
|
throw new RuntimeException('source [' . $source_name . '] license file is not set, please check config/source.json');
|
||||||
|
}
|
||||||
if (!file_exists(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $in_path)) {
|
if (!file_exists(SOURCE_PATH . '/' . ($custom_base_path ?? $source_name) . '/' . $in_path)) {
|
||||||
throw new RuntimeException('source [' . $source_name . '] license file [' . $in_path . '] not exist');
|
throw new RuntimeException('source [' . $source_name . '] license file [' . $in_path . '] not exist');
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user