mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-05 15:55:39 +08:00
Add pack lib command
This commit is contained in:
33
src/StaticPHP/Command/Dev/PackLibCommand.php
Normal file
33
src/StaticPHP/Command/Dev/PackLibCommand.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace StaticPHP\Command\Dev;
|
||||
|
||||
use StaticPHP\Command\BaseCommand;
|
||||
use StaticPHP\Package\PackageInstaller;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
|
||||
#[AsCommand('dev:pack-lib', 'Packs a library package for distribution')]
|
||||
class PackLibCommand extends BaseCommand
|
||||
{
|
||||
public function configure(): void
|
||||
{
|
||||
$this->addArgument('library', InputArgument::REQUIRED, 'The library will be compiled');
|
||||
$this->addOption('show-libc-ver', null, null);
|
||||
}
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
$library = $this->getArgument('library');
|
||||
$show_libc_ver = $this->getOption('show-libc-ver');
|
||||
|
||||
$installer = new PackageInstaller(['pack-mode' => true]);
|
||||
$installer->addBuildPackage($library);
|
||||
|
||||
$installer->run();
|
||||
|
||||
return static::SUCCESS;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user