2025-04-08 23:00:21 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Loom\Spinner\Command;
|
|
|
|
|
|
|
|
use Symfony\Component\Console\Attribute\AsCommand;
|
|
|
|
use Symfony\Component\Console\Command\Command;
|
2025-04-12 10:47:55 +01:00
|
|
|
use Symfony\Component\Console\Input\InputArgument;
|
2025-04-08 23:00:21 +01:00
|
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
|
|
use Symfony\Component\Console\Output\OutputInterface;
|
|
|
|
|
|
|
|
#[AsCommand(name: 'spin', description: 'Spin up a new development environment')]
|
|
|
|
class SpinCommand extends AbstractSpinnerCommand
|
|
|
|
{
|
2025-04-12 10:47:55 +01:00
|
|
|
protected function configure(): void
|
|
|
|
{
|
|
|
|
$this
|
|
|
|
->addArgument('name', InputArgument::REQUIRED, 'The name for your Docker container.')
|
|
|
|
->addArgument('path', InputArgument::REQUIRED, 'The absolute path to your projects root directory.');
|
|
|
|
}
|
|
|
|
|
2025-04-08 23:00:21 +01:00
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): int
|
|
|
|
{
|
2025-04-12 15:14:28 +01:00
|
|
|
if (!parent::execute($input, $output)) {
|
2025-04-12 10:47:55 +01:00
|
|
|
return Command::FAILURE;
|
|
|
|
}
|
|
|
|
|
2025-04-08 23:00:21 +01:00
|
|
|
return Command::SUCCESS;
|
|
|
|
}
|
|
|
|
}
|