Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

527 duplicated messages at some commands #528

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/translations/console.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ commands:
invalid_cache: Cache "%s" is invalid.
questions:
cache: Select cache.
chain:
description: Chain command execution
config:
export:
description: Export current application configuration.
Expand Down
60 changes: 60 additions & 0 deletions src/Command/ChainCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<?php
/**
* @file
* Contains \Drupal\AppConsole\Command\ChainCommand.
*/
namespace Drupal\AppConsole\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;

class ChainCommand extends ContainerAwareCommand
{
/**
* {@inheritdoc}
*/
protected function configure()
{
$this
->setName('chain')
->setDescription($this->trans('commands.chain.description'))
;
}

/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$interactive = false;

$learning = false;
if ($input->hasOption('learning')) {
$learning = $input->getOption('learning');
}

$generateModuleInputs = [
'--module' => 'Example module',
'--machine-name' => 'example',
'--module-path' => DRUPAL_ROOT . '/modules/custom/',
'--description' => 'My example module',
'--core' => '8.x',
'--package' => 'Test',
'--test' => false,
'--controller' => false,
];

$this->getHelper('chain')->addCommand('generate:module', $generateModuleInputs, $interactive, $learning);

$generateControllerInputs = [
'--module' => 'example',
'--class-name' => 'ExampleController',
'--method-name' => 'index',
'--route'=>'/index',
'--services' => 'twig',
];

$this->getHelper('chain')->addCommand('generate:controller', $generateControllerInputs, $interactive, $learning);
}
}
2 changes: 0 additions & 2 deletions src/EventSubscriber/ShowGeneratedFilesListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ public function showGeneratedFiles(ConsoleTerminateEvent $event)
$application = $command->getApplication();
$messageHelper = $application->getHelperSet()->get('message');

$messageHelper->showMessages($output);

if ($event->getExitCode() != 0) {
return;
}
Expand Down