修改打包命令

This commit is contained in:
JaguarJack 2020-07-11 16:12:17 +08:00
parent bcdf6cd9c7
commit b9c156e5a7

View File

@ -9,24 +9,30 @@ use think\console\Input;
use think\console\input\Argument;
use think\console\Output;
/**
* 打包模块
*
* Class CompressPackageCommand
* @package catcher\command\Tools
*/
class CompressPackageCommand extends Command
{
protected function configure()
{
// 指令配置
$this->setName('package:zip')
->addArgument('package', Argument::REQUIRED, 'package name')
->setDescription('compress package to zip');
$this->setName('catch:unpack ')
->addArgument('module', Argument::REQUIRED, 'module name')
->setDescription('compress module to zip');
}
protected function execute(Input $input, Output $output)
{
$package = $this->input->getArgument('package');
$package = $this->input->getArgument('module');
try {
(new Compress())->moduleToZip($package);
} catch (\Exception $e) {
$output->error($e->getMessage());
exit($output->error($e->getMessage()));
}
$output->info($package . ' zip successfully~');