Skip to content

Commit 52a3437

Browse files
committed
fix: do not use deprecated config var for org create
1 parent e89ce56 commit 52a3437

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

src/commands/force/org/beta/create.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
Messages,
1818
Org,
1919
OrgTypes,
20+
OrgConfigProperties,
2021
ResultEvent,
2122
SandboxEvents,
2223
SandboxProcessObject,
@@ -274,7 +275,7 @@ export class Create extends SfdxCommand {
274275
config = await Config.create({ isGlobal: true });
275276
}
276277
const value = globalInfo.aliases.get(username) || username;
277-
const result = config.set(SfdxPropertyKeys.DEFAULT_USERNAME, value);
278+
const result = config.set(OrgConfigProperties.TARGET_ORG, value);
278279
await config.write();
279280
this.logger.debug('Set defaultUsername: %s result: %s', this.flags.setdefaultusername, result);
280281
}

test/commands/force/org/scratchOrgCreate.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ describe('org:create', () => {
231231
});
232232
expect(aliasUpdateStub.firstCall.args).to.deep.equal(['scratchOrgAlias', 'newScratchUsername']);
233233
expect(aliasGetStub.firstCall.args).to.deep.equal(['newScratchUsername']);
234-
expect(configStub.firstCall.args).to.deep.equal(['defaultusername', 'newScratchUsername']);
234+
expect(configStub.firstCall.args).to.deep.equal(['target-org', 'newScratchUsername']);
235235
});
236236

237237
it('will set alias as default', async () => {
@@ -283,7 +283,7 @@ describe('org:create', () => {
283283
});
284284
expect(aliasUpdateStub.firstCall.args).to.deep.equal(['scratchOrgAlias', 'newScratchUsername']);
285285
expect(aliasGetStub.firstCall.args).to.deep.equal(['newScratchUsername']);
286-
expect(configStub.firstCall.args).to.deep.equal(['defaultusername', 'scratchOrgAlias']);
286+
expect(configStub.firstCall.args).to.deep.equal(['target-org', 'scratchOrgAlias']);
287287
});
288288

289289
it('will test json output', async () => {

yarn.lock

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,18 @@
396396
dependencies:
397397
chalk "^4.0.0"
398398

399+
"@cspotcode/[email protected]":
400+
version "0.8.0"
401+
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz#33bf4b7b39c178821606f669bbc447a6a629786b"
402+
integrity sha512-41qniHzTU8yAGbCp04ohlmSrZf8bkf/iJsl3V0dRGsQN/5GFfx+LbCSsCpp2gqrqjTVg/K6O8ycoV35JIwAzAg==
403+
404+
"@cspotcode/[email protected]":
405+
version "0.7.0"
406+
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.7.0.tgz#4789840aa859e46d2f3173727ab707c66bf344f5"
407+
integrity sha512-X4xqRHqN8ACt2aHVe51OxeA2HjbcL4MqFqXkrmQszJ1NOUuUu5u6Vqx/0lZSVNku7velL5FC/s5uEAj1lsBMhA==
408+
dependencies:
409+
"@cspotcode/source-map-consumer" "0.8.0"
410+
399411
"@cspotcode/source-map-support@^0.8.0":
400412
version "0.8.1"
401413
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
@@ -7867,7 +7879,7 @@ uuid@^3.3.2, uuid@^3.3.3:
78677879
resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee"
78687880
integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==
78697881

7870-
v8-compile-cache-lib@^3.0.1:
7882+
v8-compile-cache-lib@^3.0.0, v8-compile-cache-lib@^3.0.1:
78717883
version "3.0.1"
78727884
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
78737885
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==

0 commit comments

Comments
 (0)