fix: added the interactive condition to the password question and in non-interactive mode sent the password directly

Signed-off-by: yemkareems <yemkareems@gmail.com>
This commit is contained in:
yemkareems 2025-11-14 16:05:14 +05:30
parent 93c3079637
commit d420b3f157
No known key found for this signature in database
GPG key ID: 4293DA00B9478934

View file

@ -278,8 +278,12 @@ class EncryptAll {
$this->writePasswordsToFile($newPasswords);
$this->output->writeln('');
$question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false);
if ($this->questionHelper->ask($this->input, $this->output, $question)) {
if ($this->input->isInteractive()) {
$question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false);
if ($this->questionHelper->ask($this->input, $this->output, $question)) {
$this->sendPasswordsByMail();
}
} elseif (!$this->input->isInteractive() && $this->input->getOption('no-interaction')) {
$this->sendPasswordsByMail();
}
}