Skip to content

Commit d420b3f

Browse files
committed
fix: added the interactive condition to the password question and in non-interactive mode sent the password directly
Signed-off-by: yemkareems <[email protected]>
1 parent 93c3079 commit d420b3f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

apps/encryption/lib/Crypto/EncryptAll.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,12 @@ protected function outputPasswords(): void {
278278
$this->writePasswordsToFile($newPasswords);
279279

280280
$this->output->writeln('');
281-
$question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false);
282-
if ($this->questionHelper->ask($this->input, $this->output, $question)) {
281+
if ($this->input->isInteractive()) {
282+
$question = new ConfirmationQuestion('Do you want to send the passwords directly to the users by mail? (y/n) ', false);
283+
if ($this->questionHelper->ask($this->input, $this->output, $question)) {
284+
$this->sendPasswordsByMail();
285+
}
286+
} elseif (!$this->input->isInteractive() && $this->input->getOption('no-interaction')) {
283287
$this->sendPasswordsByMail();
284288
}
285289
}

0 commit comments

Comments
 (0)