Refactor to separate commands
This commit is contained in:
parent
1350899e8f
commit
b4e7a71fe3
7 changed files with 271 additions and 159 deletions
28
src/Console/Command/InstallCommand.php
Normal file
28
src/Console/Command/InstallCommand.php
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?php
|
||||
|
||||
namespace App\Console\Command;
|
||||
|
||||
use App\Process\Process;
|
||||
use Symfony\Component\Console\Command\Command;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
final class InstallCommand extends AbstractCommand
|
||||
{
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$extraArgs = $input->getOption('extra-args');
|
||||
$workingDir = $input->getOption('working-dir');
|
||||
|
||||
// TODO: Composer in Docker Compose?
|
||||
$process = Process::create(
|
||||
command: ['composer', 'install'],
|
||||
extraArgs: $extraArgs,
|
||||
workingDir: $workingDir,
|
||||
);
|
||||
|
||||
$process->run();
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
}
|
Reference in a new issue