Skip to content
Permalink
Browse files

[generate:site:alias] Add drupal console binary option (#349)

  • Loading branch information...
harold20 authored and enzolutions committed May 17, 2019
1 parent c897e04 commit db3fa22be00718769e79fc9c4c19b6cf7b79284f
Showing with 27 additions and 1 deletion.
  1. +21 −0 src/Command/Generate/SiteAliasCommand.php
  2. +6 −1 templates/core/sites/alias.yml.twig
@@ -47,6 +47,7 @@ class SiteAliasCommand extends Command
private $extraOptions = [
'ssh' => [
'none' => '',
'tty' => '-tt',
'vagrant' => '-o PasswordAuthentication=no -i ~/.vagrant.d/insecure_private_key',
],
'container' => [
@@ -131,6 +132,12 @@ protected function configure()
InputOption::VALUE_OPTIONAL,
$this->trans('commands.generate.site.alias.options.port')
)
->addOption(
'drupal-console-binary',
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.generate.site.alias.options.drupal-console-binary')
)
->addOption(
'extra-options',
null,
@@ -232,6 +239,19 @@ protected function interact(
}
if ($type !== 'local') {
$drupalConsoleBinary = $input->getOption('drupal-console-binary');
if (!$drupalConsoleBinary) {
$drupalConsoleBinary = $this->getIo()->askEmpty(
$this->trans(
'commands.generate.site.alias.questions.drupal-console-binary'
),
'drupal'
);
$input->setOption('drupal-console-binary', $drupalConsoleBinary);
}
$extraOptions = $input->getOption('extra-options');
if (!$extraOptions) {
$options = array_values($this->extraOptions[$type]);
@@ -308,6 +328,7 @@ protected function execute(
'environment' => $input->getOption('environment'),
'type' => $input->getOption('type'),
'extra_options' => $input->getOption('extra-options'),
'drupal_console_binary' => $input->getOption('drupal-console-binary'),
'root' => $input->getOption('composer-root'),
'uri' => $input->getOption('site-uri'),
'port' => $input->getOption('port'),
@@ -10,9 +10,14 @@
{% if user %}
user: {{ user }}
{% endif %}
{% if uri %}
{% if uri or drupal_console_binary %}
options:
{% if uri %}
uri: {{ uri }}
{% endif %}
{% if drupal_console_binary %}
drupal-console-binary: {{ drupal_console_binary }}
{% endif %}
{% else %}
# options:
{% endif %}

0 comments on commit db3fa22

Please sign in to comment.
You can’t perform that action at this time.