Skip to content

Commit 4f95931

Browse files
committed
fix: print defaultmarker for org
1 parent 228d2b4 commit 4f95931

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

src/commands/force/org/list.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ export class OrgListCommand extends SfdxCommand {
120120
protected printOrgTable(nonScratchOrgs: ExtendedAuthFields[], skipconnectionstatus: boolean): void {
121121
// default columns for the non-scratch org list
122122
let nonScratchOrgColumns = {
123-
defaultMarker: { header: '' },
123+
defaultMarker: {
124+
header: '',
125+
get: (data: ExtendedAuthFields): string => data.defaultMarker ?? '',
126+
},
124127
alias: { header: 'ALIAS' },
125128
username: { header: 'USERNAME' },
126129
orgId: { header: 'ORG ID' },
@@ -165,7 +168,10 @@ export class OrgListCommand extends SfdxCommand {
165168
private getScratchOrgColumnData(): Partial<CliUx.Table.table.Columns<Record<string, string>>> {
166169
// default columns for the scratch org list
167170
let scratchOrgColumns = {
168-
defaultMarker: { header: '' },
171+
defaultMarker: {
172+
header: '',
173+
get: (data: ExtendedAuthFields): string => data.defaultMarker ?? '',
174+
},
169175
alias: { header: 'ALIAS' },
170176
username: { header: 'USERNAME' },
171177
orgId: { header: 'ORG ID' },

src/shared/orgListUtil.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import { basename, join } from 'path';
88
import * as fs from 'fs/promises';
99

10-
import { Org, AuthInfo, sfdc, ConfigAggregator, Global, AuthFields, Logger, SfError } from '@salesforce/core';
10+
import { Org, AuthInfo, sfdc, SfdxConfigAggregator, Global, AuthFields, Logger, SfError } from '@salesforce/core';
1111
import { Dictionary, JsonMap } from '@salesforce/ts-types';
1212
import { Record } from 'jsforce';
1313
import { omit } from '@salesforce/kit/lib';
@@ -164,7 +164,7 @@ export class OrgListUtil {
164164
scratchOrgs: [],
165165
nonScratchOrgs: [],
166166
};
167-
const config = (await ConfigAggregator.create()).getConfig();
167+
const config = (await SfdxConfigAggregator.create()).getConfig();
168168

169169
for (const authInfo of authInfos) {
170170
let currentValue: ExtendedAuthFields;
@@ -210,14 +210,11 @@ export class OrgListUtil {
210210

211211
/** Identify the default orgs */
212212
public static identifyDefaultOrgs(orgInfo: ExtendedAuthFields, config: JsonMap): void {
213-
if (
214-
config.defaultusername &&
215-
(orgInfo.username === config.defaultusername || orgInfo.alias === config.defaultusername)
216-
) {
213+
if (config['target-org'] && (orgInfo.username === config['target-org'] || orgInfo.alias === config['target-org'])) {
217214
orgInfo.isDefaultUsername = true;
218215
} else if (
219-
config.defaultdevhubusername &&
220-
(orgInfo.username === config.defaultdevhubusername || orgInfo.alias === config.defaultdevhubusername)
216+
config['target-dev-hub'] &&
217+
(orgInfo.username === config['target-dev-hub'] || orgInfo.alias === config['target-dev-hub'])
221218
) {
222219
orgInfo.isDefaultDevHubUsername = true;
223220
}

0 commit comments

Comments
 (0)