diff options
author | Bernhard Ostertag <bernieo.code@gmx.de> | 2019-12-29 11:03:51 +0100 |
---|---|---|
committer | Bernhard Ostertag <bernieo.code@gmx.de> | 2019-12-29 11:03:51 +0100 |
commit | 6a017eb205c6c37d01d76495e2084f5e1ff4fd17 (patch) | |
tree | d12058841f001c3be2f3c22e8828761b7ee77b83 /core | |
parent | fe0e47bf5e80a284f1fe97513d6060550f1eeda8 (diff) | |
download | nextcloud-server-6a017eb205c6c37d01d76495e2084f5e1ff4fd17.tar.gz nextcloud-server-6a017eb205c6c37d01d76495e2084f5e1ff4fd17.zip |
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>
Diffstat (limited to 'core')
-rw-r--r-- | core/Command/Db/ConvertType.php | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index 8b6f2b10c75..3c5d62aa4bd 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -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); |