mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
sort pkg.json
This commit is contained in:
parent
a30e054d7d
commit
8376122634
@ -1,32 +1,32 @@
|
|||||||
{
|
{
|
||||||
"upx-x86_64-linux": {
|
"musl-toolchain-x86_64-linux": {
|
||||||
"type": "url",
|
"type": "url",
|
||||||
"url": "https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-amd64_linux.tar.xz",
|
"url": "https://dl.static-php.dev/static-php-cli/deps/musl-toolchain/x86_64-musl-toolchain.tgz"
|
||||||
"extract-files": {
|
},
|
||||||
"upx": "{pkg_root_path}/bin/upx"
|
"nasm-x86_64-win": {
|
||||||
}
|
"type": "url",
|
||||||
},
|
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
|
||||||
"upx-aarch64-linux": {
|
"extract-files": {
|
||||||
"type": "url",
|
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
||||||
"url": "https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-arm64_linux.tar.xz",
|
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
||||||
"extract-files": {
|
}
|
||||||
"upx": "{pkg_root_path}/bin/upx"
|
},
|
||||||
}
|
"strawberry-perl-x86_64-win": {
|
||||||
},
|
"type": "url",
|
||||||
"nasm-x86_64-win": {
|
"url": "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip"
|
||||||
"type": "url",
|
},
|
||||||
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.16.01/win64/nasm-2.16.01-win64.zip",
|
"upx-aarch64-linux": {
|
||||||
"extract-files": {
|
"type": "url",
|
||||||
"nasm-2.16.01/nasm.exe": "{php_sdk_path}/bin/nasm.exe",
|
"url": "https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-arm64_linux.tar.xz",
|
||||||
"nasm-2.16.01/ndisasm.exe": "{php_sdk_path}/bin/ndisasm.exe"
|
"extract-files": {
|
||||||
}
|
"upx": "{pkg_root_path}/bin/upx"
|
||||||
},
|
}
|
||||||
"strawberry-perl-x86_64-win": {
|
},
|
||||||
"type": "url",
|
"upx-x86_64-linux": {
|
||||||
"url": "https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_5380_5361/strawberry-perl-5.38.0.1-64bit-portable.zip"
|
"type": "url",
|
||||||
},
|
"url": "https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-amd64_linux.tar.xz",
|
||||||
"musl-toolchain-x86_64-linux": {
|
"extract-files": {
|
||||||
"type": "url",
|
"upx": "{pkg_root_path}/bin/upx"
|
||||||
"url": "https://dl.static-php.dev/static-php-cli/deps/musl-toolchain/x86_64-musl-toolchain.tgz"
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,6 +57,15 @@ class SortConfigCommand extends BaseCommand
|
|||||||
return static::FAILURE;
|
return static::FAILURE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'pkg':
|
||||||
|
$file = json_decode(FileSystem::readFile(ROOT_DIR . '/config/pkg.json'), true);
|
||||||
|
ConfigValidator::validatePkgs($file);
|
||||||
|
ksort($file);
|
||||||
|
if (!file_put_contents(ROOT_DIR . '/config/pkg.json', json_encode($file, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) . "\n")) {
|
||||||
|
$this->output->writeln('<error>Write file pkg.json failed!</error>');
|
||||||
|
return static::FAILURE;
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$this->output->writeln("<error>invalid config name: {$name}</error>");
|
$this->output->writeln("<error>invalid config name: {$name}</error>");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
@ -70,4 +70,9 @@ class ConfigValidator
|
|||||||
{
|
{
|
||||||
is_array($data) || throw new ValidationException('ext.json is broken');
|
is_array($data) || throw new ValidationException('ext.json is broken');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function validatePkgs(mixed $data): void
|
||||||
|
{
|
||||||
|
is_array($data) || throw new \_PHPStan_c997ea9ee\Nette\Schema\ValidationException('pkg.json is broken');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user