Skip to content

Commit 17090c2

Browse files
authored
Merge pull request #668 from salesforcecli/sm/deprecate-force-org-create
feat: gentle deprecation warning for force:org:create
2 parents 31cca74 + 50ed6c4 commit 17090c2

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

messages/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Create a scratch org or sandbox.
44

55
# deprecation
66

7-
The force:org:create command is deprecated. Use org:create:scratch or org:create:sandbox.
7+
The force:org:create command has been replaced. Try org:create:scratch or org:create:sandbox.
88

99
# description
1010

src/commands/force/org/create.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,10 @@ export class Create extends SfCommand<CreateResult> {
5454
public static readonly description = messages.getMessage('description');
5555
public static readonly examples = messages.getMessages('examples');
5656

57-
// waiting for oclif bug fix around missing config.id.
58-
// public static state = 'deprecated';
59-
// public static deprecationOptions = {
60-
// message: messages.getMessage('deprecation'),
61-
// };
57+
public static state = 'deprecated';
58+
public static deprecationOptions = {
59+
message: messages.getMessage('deprecation'),
60+
};
6261

6362
// needed to allow varargs
6463
public static readonly strict = false;

test/unit/force/org/scratchOrgCreate.test.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,9 @@ describe('org:create', () => {
289289
warnings,
290290
});
291291
await runCreateCommand(['--type', 'scratch', '--definitionfile', definitionfile, '-v', testHub.username]);
292-
expect(sfCommandUxStubs.warn.callCount).to.equal(2);
293-
expect(sfCommandUxStubs.warn.callCount).to.equal(2);
294-
expect(sfCommandUxStubs.warn.firstCall.firstArg).to.equal(warnings[0]);
295-
expect(sfCommandUxStubs.warn.firstCall.firstArg).to.equal(warnings[0]);
296-
expect(sfCommandUxStubs.warn.secondCall.firstArg).to.equal(warnings[1]);
297-
expect(sfCommandUxStubs.warn.secondCall.firstArg).to.equal(warnings[1]);
292+
expect(sfCommandUxStubs.warn.callCount).to.be.greaterThanOrEqual(2);
293+
expect(sfCommandUxStubs.warn.getCalls().flatMap((c) => c.args)).to.have.include(warnings[0]);
294+
expect(sfCommandUxStubs.warn.getCalls().flatMap((c) => c.args)).to.have.include(warnings[1]);
298295
});
299296
});
300297

0 commit comments

Comments
 (0)