1 | <?php |
||
2 | |||
3 | namespace Deploid\Command; |
||
4 | |||
5 | use Symfony\Component\Console\Command\Command; |
||
6 | use Symfony\Component\Console\Input\InputInterface; |
||
7 | use Symfony\Component\Console\Output\OutputInterface; |
||
8 | use Symfony\Component\Console\Input\InputArgument; |
||
9 | |||
10 | /** |
||
11 | * @method \Deploid\Application getApplication() return application object |
||
12 | */ |
||
13 | class StructureInit extends Command { |
||
14 | |||
15 | protected function configure() { |
||
16 | $this->setName('structure:init'); |
||
17 | $this->setDescription('Initialize new directory structure'); |
||
18 | $this->setHelp('This command initialize a directory structure in the specified path'); |
||
19 | $this->addArgument('path', InputArgument::OPTIONAL, 'path to target directory', getcwd()); |
||
20 | } |
||
21 | |||
22 | protected function execute(InputInterface $input, OutputInterface $output) { |
||
23 | $payload = $this->getApplication()->deploidStructureInit($input->getArgument('path')); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
24 | $output->writeln($payload->getMessage()); |
||
25 | return $payload->getCode(); |
||
26 | } |
||
27 | |||
28 | } |