Skip to content

Commit cccbd6c

Browse files
committed
fix: check for both sf and sfdx env vars
1 parent 7eb69f4 commit cccbd6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/commands/org/open.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ export class OrgOpenCommand extends SfCommand<OrgOpenOutput> {
7272
this.conn = this.org.getConnection(flags['api-version']);
7373

7474
let url = await this.buildFrontdoorUrl();
75+
const env = new Env();
7576

7677
if (flags['source-file']) {
7778
url += `&retURL=${await this.generateFileUrl(flags['source-file'])}`;
@@ -83,7 +84,8 @@ export class OrgOpenCommand extends SfCommand<OrgOpenOutput> {
8384
// TODO: better typings in sfdx-core for orgs read from auth files
8485
const username = this.org.getUsername() as string;
8586
const output = { orgId, url, username };
86-
const containerMode = new Env().getBoolean('SFDX_CONTAINER_MODE');
87+
// NOTE: Deliberate use of `||` here since getBoolean() defaults to false, and we need to consider both env vars.
88+
const containerMode = env.getBoolean('SF_CONTAINER_MODE') || env.getBoolean('SFDX_CONTAINER_MODE');
8789

8890
// security warning only for --json OR --url-only OR containerMode
8991
if (flags['url-only'] || Boolean(flags.json) || containerMode) {
@@ -115,7 +117,8 @@ export class OrgOpenCommand extends SfCommand<OrgOpenOutput> {
115117
if (err instanceof Error) {
116118
if (err.message.includes('timeout')) {
117119
const domain = `https://${/https?:\/\/([^.]*)/.exec(url)?.[1]}.lightning.force.com`;
118-
const timeout = new Duration(new Env().getNumber('SFDX_DOMAIN_RETRY', 240), Duration.Unit.SECONDS);
120+
const domainRetryTimeout = env.getNumber('SF_DOMAIN_RETRY') ?? env.getNumber('SFDX_DOMAIN_RETRY', 240);
121+
const timeout = new Duration(domainRetryTimeout, Duration.Unit.SECONDS);
119122
const logger = await Logger.child(this.constructor.name);
120123
logger.debug(`Did not find IP for ${domain} after ${timeout.seconds} seconds`);
121124
throw new SfError(messages.getMessage('domainTimeoutError'), 'domainTimeoutError');

0 commit comments

Comments
 (0)