From 021a3f47baea85bddfbd6c04b901bb3a232af953 Mon Sep 17 00:00:00 2001 From: Willie Ruemmele Date: Wed, 27 Jan 2021 16:47:23 -0700 Subject: [PATCH] fix: add safety net around passwordGenerate in var args --- src/commands/force/user/create.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commands/force/user/create.ts b/src/commands/force/user/create.ts index 20d02eb6..a184caf7 100644 --- a/src/commands/force/user/create.ts +++ b/src/commands/force/user/create.ts @@ -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';