diff --git a/src/commands/org/create/user.ts b/src/commands/org/create/user.ts index d0b4ade9..36bd3463 100644 --- a/src/commands/org/create/user.ts +++ b/src/commands/org/create/user.ts @@ -151,8 +151,7 @@ export class CreateUserCommand extends SfCommand { // Set the alias if specified if (flags['set-alias']) { const stateAggregator = await StateAggregator.getInstance(); - stateAggregator.aliases.set(flags['set-alias'], fields.username); - await stateAggregator.aliases.write(); + await stateAggregator.aliases.setAndSave(flags['set-alias'], fields.username); } fields.id = ensureString(newUserAuthInfo.getFields().userId);