New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a simple Confirmation if --append option isn't set #58
Conversation
Add a simple Confirmation if --append option isn't set
This breaks things when the input is not interactive (as it will wait for the confirmation forever). You need to add this check only conditionally. |
what do you think about adding a --forced option like for the doctrine:schema:update. I guess it could prevent mistakes |
you don't need a force. You simply need to check if the input is interactive before asking confirmation (the DoctrineMigrationsBundle does it) |
Ok done, I didn't know this interactive method. Thanks for the tip |
@@ -68,6 +68,15 @@ protected function execute(InputInterface $input, OutputInterface $output) | |||
$doctrine = $this->getContainer()->get('doctrine'); | |||
$em = $doctrine->getManager($input->getOption('em')); | |||
|
|||
if ($input->isInteractive()) { | |||
if (!$input->getOption('append')){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use &&
instead of nesting 2 if
done |
Add a simple Confirmation if --append option isn't set
Add a simple Confirmation if --append option isn't set