Browse Source

adding #22

release/0.1
Björn 4 years ago
parent
commit
bc9759b683
1 changed files with 25 additions and 4 deletions
  1. +25
    -4
      app/Commands/NginxVhostsCommand.php

+ 25
- 4
app/Commands/NginxVhostsCommand.php View File

@ -131,7 +131,14 @@ class NginxVhostsCommand extends Command
// input domain // input domain
->addItem('domain: -', function(CliMenu $menu) use (&$configuration) { ->addItem('domain: -', function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$input = $menu->askText();
if ($configuration['domain']) {
$input->setPlaceholderText($configuration['domain']);
}
$result = $input->ask();
$configuration['domain'] = $result->fetch(); $configuration['domain'] = $result->fetch();
$menu->getSelectedItem()->setText('domain: '.$result->fetch()); $menu->getSelectedItem()->setText('domain: '.$result->fetch());
@ -140,7 +147,14 @@ class NginxVhostsCommand extends Command
// input root // input root
->addItem('root: -', function(CliMenu $menu) use (&$configuration) { ->addItem('root: -', function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$input = $menu->askText();
if ($configuration['root']) {
$input->setPlaceholderText($configuration['root']);
}
$result = $input->ask();
$configuration['root'] = $result->fetch(); $configuration['root'] = $result->fetch();
$menu->getSelectedItem()->setText('root: '.$result->fetch()); $menu->getSelectedItem()->setText('root: '.$result->fetch());
@ -149,7 +163,14 @@ class NginxVhostsCommand extends Command
// input index // input index
->addItem('index: '.$configuration['index'], function(CliMenu $menu) use (&$configuration) { ->addItem('index: '.$configuration['index'], function(CliMenu $menu) use (&$configuration) {
$result = $menu->askText()->ask();
$input = $menu->askText();
if ($configuration['index']) {
$input->setPlaceholderText($configuration['index']);
}
$result = $input->ask();
$configuration['index'] = $result->fetch(); $configuration['index'] = $result->fetch();
$menu->getSelectedItem()->setText('index: '.$result->fetch()); $menu->getSelectedItem()->setText('index: '.$result->fetch());
@ -204,7 +225,7 @@ class NginxVhostsCommand extends Command
$bladeFile->put($template['name'], '/etc/nginx/sites-available/'.$filename, $configuration); $bladeFile->put($template['name'], '/etc/nginx/sites-available/'.$filename, $configuration);
$menu->confirm('Success!')->display('Ok!'); $menu->confirm('Success!')->display('Ok!');
// invoke action
// invoke action
$action = new NginxVhostGoBackAction(); $action = new NginxVhostGoBackAction();
is_callable($action($menu)); is_callable($action($menu));
} }


Loading…
Cancel
Save