Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: org list now lists all scratch orgs properly #359

Merged
merged 3 commits into from
Jul 28, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/shared/orgListUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ export class OrgListUtil {
}
// Theory: within <orgId>.json, if the userId is the first entry, that's the primary username.
if (orgFileNames.includes(orgFileName)) {
const orgFileContent = JSON.parse(
await fs.readFile(join(Global.SFDX_STATE_FOLDER, orgFileName), 'utf8')
) as { usernames: string[] };
const orgFileContent = JSON.parse(await fs.readFile(join(Global.SFDX_DIR, orgFileName), 'utf8')) as {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Global.SFDX_STATE_FOLDER is a const, where Global.SFDX_DIR is a getter that resolved the state folder path. The cost was causing all reads to fail with file not found.

usernames: string[];
};
const usernames = orgFileContent.usernames;
if (usernames && usernames[0] === auth.getFields().username) {
return auth;
Expand Down