Skip to content

Commit

Permalink
[config:import | config:export] Added interactive mode (#4097)
Browse files Browse the repository at this point in the history
* [update:execute] Fixed update table

* Revert "Merge remote-tracking branch 'upstream/master'"

This reverts commit ddf7739, reversing
changes made to a95b7e6.

* [config:import | config:export] Added interative mode
  • Loading branch information
hjuarez20 authored and enzolutions committed Jun 21, 2019
1 parent 9adfcba commit 02498e8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
25 changes: 19 additions & 6 deletions src/Command/Config/ExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ protected function configure()
null,
InputOption::VALUE_OPTIONAL,
$this->trans('commands.config.export.options.directory')
)
->addOption(
'tar',
null,
InputOption::VALUE_NONE,
$this->trans('commands.config.export.options.tar')
)->addOption(
'remove-uuid',
null,
Expand All @@ -72,10 +66,29 @@ protected function configure()
null,
InputOption::VALUE_NONE,
$this->trans('commands.config.export.options.remove-config-hash')
)->addOption(
'tar',
null,
InputOption::VALUE_NONE,
$this->trans('commands.config.export.options.tar')
)
->setAliases(['ce']);
}

/**
* {@inheritdoc}
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('directory')) {
$directory = $this->getIo()->ask(
$this->trans('commands.config.export.questions.directory'),
config_get_config_directory(CONFIG_SYNC_DIRECTORY)
);
$input->setOption('directory', $directory);
}
}

/**
* {@inheritdoc}
*/
Expand Down
14 changes: 14 additions & 0 deletions src/Command/Config/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,20 @@ protected function configure()
->setAliases(['ci']);
}

/**
* {@inheritdoc}
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
if (!$input->getOption('directory')) {
$directory = $this->getIo()->ask(
$this->trans('commands.config.import.questions.directory'),
config_get_config_directory(CONFIG_SYNC_DIRECTORY)
);
$input->setOption('directory', $directory);
}
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 02498e8

Please sign in to comment.