From e3aeaf6845213e447c5b2c07725a9764943e0779 Mon Sep 17 00:00:00 2001 From: Bryan Kendall Date: Wed, 22 Sep 2021 11:43:09 -0700 Subject: [PATCH] fix login:use and account resolution issue (#3773) --- CHANGELOG.md | 1 + src/command.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5578ec7f032..a99a4249af6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ - `ext:dev:publish` and `ext:update` now support --force and --non-interactive flags. +- Fixes issue where account specified by `login:use` was not being correctly loaded (#3759). diff --git a/src/command.ts b/src/command.ts index ea285d673a8..db70c24d726 100644 --- a/src/command.ts +++ b/src/command.ts @@ -260,6 +260,9 @@ export class Command { const account = getInheritedOption(options, "account"); options.account = account; + // selectAccount needs the projectRoot to be set. + options.projectRoot = detectProjectRoot(options); + const projectRoot = options.projectRoot; const activeAccount = selectAccount(account, projectRoot); @@ -267,7 +270,6 @@ export class Command { setActiveAccount(options, activeAccount); } - options.projectRoot = detectProjectRoot(options); this.applyRC(options); if (options.project) { await this.resolveProjectIdentifiers(options);