mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-18 04:44:53 +08:00
Correct install-pkg argument name, add alias
This commit is contained in:
parent
20892ab194
commit
dc5bf6dc98
@ -8,19 +8,19 @@ use StaticPHP\DI\ApplicationContext;
|
||||
use StaticPHP\Package\PackageInstaller;
|
||||
use Symfony\Component\Console\Attribute\AsCommand;
|
||||
|
||||
#[AsCommand('install-pkg')]
|
||||
#[AsCommand('install-pkg', 'Install additional packages', ['i', 'install-package'])]
|
||||
class InstallPackageCommand extends BaseCommand
|
||||
{
|
||||
public function configure()
|
||||
{
|
||||
$this->addArgument('package', null, 'The package to install (name or path)');
|
||||
$this->addArgument('packages', null, 'The package to install (name or path)');
|
||||
}
|
||||
|
||||
public function handle(): int
|
||||
{
|
||||
ApplicationContext::set('elephant', true);
|
||||
$installer = new PackageInstaller([...$this->input->getOptions(), 'dl-prefer-binary' => true]);
|
||||
$installer->addInstallPackage($this->input->getArgument('package'));
|
||||
$installer->addInstallPackage($this->input->getArgument('packages'));
|
||||
$installer->run(true, true);
|
||||
return static::SUCCESS;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user