]> source.dussan.org Git - nextcloud-server.git/commitdiff
Introduce new variable with the default answer to allow option --no-interaction for... 18576/head
authorBernhard Ostertag <bernieo.code@gmx.de>
Sun, 29 Dec 2019 10:03:51 +0000 (11:03 +0100)
committerBernhard Ostertag <bernieo.code@gmx.de>
Sun, 29 Dec 2019 10:03:51 +0000 (11:03 +0100)
Variable is set to true for --no-interaction and false otherwise

Signed-off-by: Bernhard Ostertag <bernieo.code@gmx.de>
core/Command/Db/ConvertType.php

index 8b6f2b10c7563f59d4a53f4c0ebca92cb898252a..3c5d62aa4bda467b1afa88d8b30cad1eee8c2b9b 100644 (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);