Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Introduce new variable with the default answer to allow option --no-i…
…nteraction for command occ db:convert-type

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

Signed-off-by: Bernhard Ostertag <[email protected]>
  • Loading branch information
BernieO committed Dec 29, 2019
commit 6a017eb205c6c37d01d76495e2084f5e1ff4fd17
14 changes: 7 additions & 7 deletions core/Command/Db/ConvertType.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ protected function execute(InputInterface $input, OutputInterface $output) {
$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);
Expand Down