From 6a1a52a0128b5f1088dd1cbb32396ad56a85b1ca Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Fri, 28 Jul 2017 01:37:49 -0700 Subject: [PATCH 1/2] [console] Tag 1.0.0-rc26 release. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0d53c88..e8bd67f 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,7 @@ "require": { "php": "^5.5.9 || ^7.0", "dflydev/dot-access-configuration": "^1.0", - "drupal/console-en": "1.0.0-rc25", + "drupal/console-en": "1.0.0-rc26", "stecman/symfony-console-completion": "~0.7", "symfony/config": "~2.8|~3.0", "symfony/console": "~2.8|~3.0", From a7283e7e609bc3832d5feca8bf0efdd91751bf8a Mon Sep 17 00:00:00 2001 From: Jesus Manuel Olivas Date: Tue, 1 Aug 2017 11:01:15 -0400 Subject: [PATCH 2/2] [console] Add drush command mapping feature. --- config/dist/aliases.yml | 6 +++++- src/Application.php | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/config/dist/aliases.yml b/config/dist/aliases.yml index b24f731..e1280a3 100644 --- a/config/dist/aliases.yml +++ b/config/dist/aliases.yml @@ -28,10 +28,14 @@ commands: - uslca user:login:url: - usli + - uli user:password:hash: - usph user:password:reset: - upsr views:disable: - vdi - + cache:rebuild: + - cc + update:execute: + - updb diff --git a/src/Application.php b/src/Application.php index b898b30..72907fc 100644 --- a/src/Application.php +++ b/src/Application.php @@ -115,6 +115,7 @@ public function doRun(InputInterface $input, OutputInterface $output) if ($commandName && !$this->has($commandName)) { + $isValidCommand = false; $config = $configurationManager->getConfiguration(); $mappings = $config ->get('application.commands.mappings'); @@ -129,7 +130,23 @@ public function doRun(InputInterface $input, OutputInterface $output) $this->add( $this->find($commandNameMap)->setAliases([$commandName]) ); - } else { + $isValidCommand = true; + } + + $drushCommand = $configurationManager->readDrushEquivalents($commandName); + if ($drushCommand) { + $this->add( + $this->find($drushCommand)->setAliases([$commandName]) + ); + $isValidCommand = true; + $messages['warning'][] = sprintf( + $this->trans('application.errors.drush-command'), + $commandName, + $drushCommand + ); + } + + if (!$isValidCommand) { $io->error( sprintf( $this->trans('application.errors.invalid-command'),