Skip to content

Commit d4d5261

Browse files
committed
fix tests
2 parents c46ec79 + 5942116 commit d4d5261

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/Console/JWTGenerateSecretCommand.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ class JWTGenerateSecretCommand extends Command
2323
*/
2424
protected $signature = 'jwt:secret
2525
{--s|show : Display the key instead of modifying files.}
26+
{--always-no : Skip generating key if it already exists.}
2627
{--f|force : Skip confirmation when overwriting an existing key.}';
2728

2829
/**
@@ -55,6 +56,12 @@ public function handle()
5556
// create new entry
5657
file_put_contents($path, PHP_EOL."JWT_SECRET=$key".PHP_EOL, FILE_APPEND);
5758
} else {
59+
if ($this->option('always-no')) {
60+
$this->comment('Secret key already exists. Skipping...');
61+
62+
return;
63+
}
64+
5865
if ($this->isConfirmed() === false) {
5966
$this->comment('Phew... No changes were made to your secret key.');
6067

0 commit comments

Comments
 (0)