Skip to content

Commit 311b19c

Browse files
committed
fix: ensure stages are capital case
1 parent 62ac5ef commit 311b19c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/commands/org/create/scratch.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {
1919
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
2020
import { Duration } from '@salesforce/kit';
2121
import terminalLink from 'terminal-link';
22+
import { capitalCase } from 'change-case';
2223
import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js';
2324
import { ScratchCreateResponse } from '../../../shared/orgTypes.js';
2425

@@ -172,7 +173,9 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
172173
);
173174

174175
const mso = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
175-
stages: flags.async ? ['prepare request', 'send request', 'done'] : scratchOrgLifecycleStages,
176+
stages: (flags.async ? ['prepare request', 'send request', 'done'] : scratchOrgLifecycleStages).map((stage) =>
177+
capitalCase(stage)
178+
),
176179
title: flags.async ? 'Creating Scratch Org (async)' : 'Creating Scratch Org',
177180
data: { alias: flags.alias },
178181
jsonEnabled: this.jsonEnabled(),
@@ -207,7 +210,7 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
207210
});
208211

209212
lifecycle.on<ScratchOrgLifecycleEvent>(scratchOrgLifecycleEventName, async (data): Promise<void> => {
210-
mso.skipTo(data.stage, data);
213+
mso.skipTo(capitalCase(data.stage), data);
211214
if (data.stage === 'done') {
212215
mso.stop();
213216
}
@@ -222,7 +225,7 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
222225
}
223226

224227
if (flags.async) {
225-
mso.skipTo('done', { scratchOrgInfo });
228+
mso.skipTo('Done', { scratchOrgInfo });
226229
mso.stop();
227230
this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
228231
} else {

src/commands/org/resume/scratch.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
} from '@salesforce/core';
2121
import terminalLink from 'terminal-link';
2222
import { MultiStageOutput } from '@oclif/multi-stage-output';
23+
import { capitalCase } from 'change-case';
2324
import { ScratchCreateResponse } from '../../../shared/orgTypes.js';
2425

2526
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
@@ -61,7 +62,7 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
6162
const hubBaseUrl = cached?.hubBaseUrl;
6263

6364
const mso = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
64-
stages: scratchOrgLifecycleStages,
65+
stages: scratchOrgLifecycleStages.map((stage) => capitalCase(stage)),
6566
title: 'Resuming Scratch Org',
6667
data: { alias: cached?.alias },
6768
jsonEnabled: this.jsonEnabled(),
@@ -96,7 +97,7 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
9697
});
9798

9899
lifecycle.on<ScratchOrgLifecycleEvent>(scratchOrgLifecycleEventName, async (data): Promise<void> => {
99-
mso.skipTo(data.stage, data);
100+
mso.skipTo(capitalCase(data.stage), data);
100101
if (data.stage === 'done') {
101102
mso.stop();
102103
}

0 commit comments

Comments
 (0)