Skip to content

Commit b91b6ed

Browse files
committed
chore: bump sfdx-core
1 parent 306dd88 commit b91b6ed

File tree

3 files changed

+632
-629
lines changed

3 files changed

+632
-629
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"bugs": "https://github.com/forcedotcom/cli/issues",
77
"dependencies": {
88
"@oclif/core": "^1.7.0",
9-
"@salesforce/core": "^3.19.3",
9+
"@salesforce/core": "^3.19.4",
1010
"@salesforce/kit": "^1.5.41",
1111
"@salesforce/sf-plugins-core": "^1.12.3",
1212
"@salesforce/source-deploy-retrieve": "^5.13.1",

src/utils/metadataDeployer.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ export class MetadataDeployer extends Deployer {
146146
public async promptForUsername(): Promise<string> {
147147
const aliasOrUsername = ConfigAggregator.getValue(OrgConfigProperties.TARGET_ORG)?.value as string;
148148
const stateAggregator = await StateAggregator.getInstance();
149+
await stateAggregator.orgs.readAll();
149150
const allAliases = stateAggregator.aliases.getAll();
150151
let targetOrgAuth: OrgAuthorization;
151152
// make sure the "target-org" can be used in this deploy
@@ -172,14 +173,17 @@ export class MetadataDeployer extends Deployer {
172173
}
173174
}
174175
}
176+
175177
if (!aliasOrUsername || targetOrgAuth?.isExpired) {
176-
const authorizations = (
178+
const promises = (
177179
await AuthInfo.listAllAuthorizations((orgAuth) => !orgAuth.error && orgAuth.isExpired !== true)
178-
).map((orgAuth) => {
179-
const org = stateAggregator.orgs.get(orgAuth.username);
180-
const timestamp = org.timestamp ? new Date(org.timestamp as string) : new Date();
180+
).map(async (orgAuth) => {
181+
const stat = await stateAggregator.orgs.stat(orgAuth.username);
182+
const timestamp = stat ? new Date(stat.mtimeMs) : new Date();
181183
return { ...orgAuth, timestamp } as OrgAuthWithTimestamp;
182184
});
185+
186+
const authorizations = await Promise.all(promises);
183187
if (authorizations.length > 0) {
184188
const newestAuths = authorizations.sort(compareOrgs);
185189
const options = newestAuths.map((auth) => ({

0 commit comments

Comments
 (0)