Skip to content

Commit

Permalink
Expose drush command to all users (#208)
Browse files Browse the repository at this point in the history
* [chain] Avoid overwrite chain command options with global/default options

* Revert "[chain] Avoid overwrite chain command options with global/default options"

This reverts commit 1096794.

* [chain] Avoid overwrite chain command options with global/default options

* Remove YAML command in behalf of new separate repository https://github.com/weknowinc/drupal-console-yaml

* Fix language separator hyphen instead of underscore

* Added constant DRUPAL_CONSOLE_LIBRARY to be used in library translations

* Expose drush command to all users

* Register drush command as a regular command
  • Loading branch information
enzolutions authored and jmolivas committed Jul 28, 2017
1 parent f77cb50 commit fb16c78
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
3 changes: 0 additions & 3 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ application:
_completion:
class: '\Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand'
name:
drush:
class: '\Drupal\Console\Core\Command\Exclude\DrushCommand'
arguments: ['@console.configuration_manager', '@console.chain_queue']
elephpant:
class: '\Drupal\Console\Core\Command\Exclude\ElephpantCommand'
arguments: ['@app.root', '@console.renderer']
Expand Down
5 changes: 5 additions & 0 deletions services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ services:
class: Drupal\Console\Core\Generator\InitGenerator
tags:
- { name: drupal.generator }
console.drush:
class: Drupal\Console\Core\Command\DrushCommand
arguments: ['@console.configuration_manager', '@console.chain_queue']
tags:
- { name: drupal.command }
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Contains \Drupal\Console\Core\Command\Exclude\DrushCommand.
*/

namespace Drupal\Console\Core\Command\Exclude;
namespace Drupal\Console\Core\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -19,7 +19,7 @@
/**
* Class DrushCommand
*
* @package Drupal\Console\Core\Command\Exclude
* @package Drupal\Console\Core\Command
*/
class DrushCommand extends Command
{
Expand Down
6 changes: 4 additions & 2 deletions src/Utils/ConfigurationManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,15 @@ public function readDrushEquivalents($commandName)
$equivalents = [];
$aliasInformation = Yaml::parse(
file_get_contents(
$this->applicationDirectory.DRUPAL_CONSOLE_CORE.'config/drush.yml'
$this->applicationDirectory . DRUPAL_CONSOLE_CORE . 'config/drush.yml'
)
);

foreach ($aliasInformation['commands'] as $key => $commands) {
foreach ($commands as $drush => $console) {
$equivalents[$drush] = $console;
if($console) {
$equivalents[$drush] = $console;
}
}
}

Expand Down

0 comments on commit fb16c78

Please sign in to comment.