Skip to content

Commit

Permalink
fix: add safety net around passwordGenerate in var args
Browse files Browse the repository at this point in the history
  • Loading branch information
WillieRuemmele committed Jan 27, 2021
1 parent 8617114 commit 021a3f4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/commands/force/user/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,12 @@ export class UserCreateCommand extends SfdxCommand {
}

// the file schema is camelCase and boolean while the cli arg is no capitialization and a string
if (defaultFields['generatepassword'] === 'true' || defaultFields['generatePassword'] === true) {
// we will add logic to capture camelcase in varargs just in case
if (
defaultFields['generatepassword'] === 'true' ||
defaultFields['generatePassword'] === 'true' ||
defaultFields['generatePassword'] === true
) {
// since only one may be set, set both variations, prefer camelCase and boolean for coding
// this will also maintain --json backwards compatibility for the all lower case scenario
defaultFields['generatepassword'] = 'true';
Expand Down

0 comments on commit 021a3f4

Please sign in to comment.