Skip to content

Commit

Permalink
Merge pull request #5 from RobDWaller/bug-cli
Browse files Browse the repository at this point in the history
Added fixes to catch when additional cli arguments are not passed to …
  • Loading branch information
RobDWaller authored Feb 11, 2019
2 parents 7c8aa61 + 7850c0c commit f55f34e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions wpsalts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ $salts = new WPSalts\Salts;
/**
* Return the WordPress salts in a DotEnv format for use in .env files.
*/
if ($argv[1] === 'dotenv') {
if ($argv[2] === '--clean') {
if (isset($argv[1]) && $argv[1] === 'dotenv') {
if (isset($argv[2]) && $argv[2] === '--clean') {
echo $salts->dotEnv();
die();
}
Expand All @@ -50,8 +50,8 @@ if ($argv[1] === 'dotenv') {
* Return the WordPress salts in the traditional WordPress define format for
* use in wp-config.php files.
*/
if ($argv[1] === 'traditional') {
if ($argv[2] === '--clean') {
if (isset($argv[1]) && $argv[1] === 'traditional') {
if (isset($argv[2]) && $argv[2] === '--clean') {
echo $salts->traditional();
die();
}
Expand Down

0 comments on commit f55f34e

Please sign in to comment.