Skip to content

Commit

Permalink
fix: fixed issue #664
Browse files Browse the repository at this point in the history
  • Loading branch information
hknokh2 committed Nov 22, 2023
1 parent 754c1c2 commit 1af074c
Show file tree
Hide file tree
Showing 2 changed files with 239 additions and 447 deletions.
12 changes: 5 additions & 7 deletions src/modules/models/script_models/scriptOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,15 @@ export default class ScriptOrg implements IAppScriptOrg, ISfdmuRunCustomAddonScr
let apiSf = new Sfdx(this);
if (!this.isFileMedia) {

// Get org info
try {
await apiSf.identityAsync();
let ret = await apiSf.queryOrgAsync("SELECT OrganizationType, IsSandbox FROM Organization LIMIT 1", false);
this.isSandbox = ret[0]["IsSandbox"];
this.organizationType = ret[0]["OrganizationType"];
} catch (ex) {
throw new CommandInitializationError(this.script.logger.getResourceString(RESOURCES.accessTokenExpired, this.name));
}

// Get org info
let ret = await apiSf.queryOrgAsync("SELECT OrganizationType, IsSandbox FROM Organization LIMIT 1", false);
this.isSandbox = ret[0]["IsSandbox"];
this.organizationType = ret[0]["OrganizationType"];

// Check person account availability
try {
await apiSf.queryOrgAsync("SELECT IsPersonAccount FROM Account LIMIT 1", false);
Expand All @@ -212,7 +210,7 @@ export default class ScriptOrg implements IAppScriptOrg, ISfdmuRunCustomAddonScr
this.script.logger.infoNormal(RESOURCES.connectingToOrgSf, this.name);
processResult = Common.execSf("org display --json", this.name)
} else {
this.script.logger.infoNormal(RESOURCES.connectingToOrg, this.name);
this.script.logger.infoNormal(RESOURCES.connectingToOrg, this.name);
processResult = Common.execSfdx("force:org:display --json", this.name);
}
let orgInfo = this._parseForceOrgDisplayResult(processResult);
Expand Down
Loading

0 comments on commit 1af074c

Please sign in to comment.