namespace Drupal\Console\Core\Command\Exec;
-use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ExecutableFinder;
-use Drupal\Console\Core\Command\Shared\CommandTrait;
use Drupal\Console\Core\Utils\ShellProcess;
-use Drupal\Console\Core\Style\DrupalStyle;
+use Drupal\Console\Core\Command\Command;
/**
* Class ExecCommand
*/
class ExecCommand extends Command
{
- use CommandTrait;
-
/**
* @var ShellProcess
*/
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
- $io = new DrupalStyle($input, $output);
$bin = $input->getArgument('bin');
$workingDirectory = $input->getOption('working-directory');
if (!$bin) {
- $io->error(
+ $this->getIo()->error(
$this->trans('commands.exec.messages.missing-bin')
);
$finder = new ExecutableFinder();
if (!$finder->find($name)) {
- $io->error(
+ $this->getIo()->error(
sprintf(
$this->trans('commands.exec.messages.binary-not-found'),
$name
}
if (!$this->shellProcess->exec($bin, $workingDirectory)) {
- $io->error(
+ $this->getIo()->error(
sprintf(
$this->trans('commands.exec.messages.invalid-bin')
)
);
- $io->writeln($this->shellProcess->getOutput());
+ $this->getIo()->writeln($this->shellProcess->getOutput());
return 1;
}
- $io->success(
+ $this->getIo()->success(
sprintf(
$this->trans('commands.exec.messages.success'),
$bin