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