Introduce new variable with the default answer to allow option --no-interaction for command occ db:convert-type

Variable is set to true for --no-interaction and false otherwise

Signed-off-by: Bernhard Ostertag <bernieo.code@gmx.de>
This commit is contained in:
Bernhard Ostertag 2019-12-29 11:03:51 +01:00
parent fe0e47bf5e
commit 6a017eb205
No known key found for this signature in database
GPG Key ID: 7D99DC27B1B6030E
1 changed files with 7 additions and 7 deletions

View File

@ -212,14 +212,14 @@ class ConvertType extends Command implements CompletionAwareInterface {
$output->writeln('<comment>can be included by specifying the --all-apps option.</comment>');
}
if ($input->isInteractive()) {
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
$question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', false);
$continueConversion = !$input->isInteractive(); // assume yes for --no-interaction and no otherwise.
$question = new ConfirmationQuestion('Continue with the conversion (y/n)? [n] ', $continueConversion);
if (!$helper->ask($input, $output, $question)) {
return;
}
/** @var QuestionHelper $helper */
$helper = $this->getHelper('question');
if (!$helper->ask($input, $output, $question)) {
return;
}
}
$intersectingTables = array_intersect($toTables, $fromTables);