Skip to content

Commit

Permalink
chore: bump mso
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Sep 4, 2024
1 parent 43c38d4 commit d256725
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions src/commands/org/create/scratch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
flags['client-id'] ? await this.secretPrompt({ message: messages.getMessage('prompt.secret') }) : undefined
);

const stager = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
const mso = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
stages: flags.async ? ['prepare request', 'send request', 'done'] : scratchOrgLifecycleStages,
title: flags.async ? 'Creating Scratch Org (async)' : 'Creating Scratch Org',
data: { alias: flags.alias },
Expand Down Expand Up @@ -207,9 +207,9 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
});

lifecycle.on<ScratchOrgLifecycleEvent>(scratchOrgLifecycleEventName, async (data): Promise<void> => {
stager.goto(data.stage, data);
mso.skipTo(data.stage, data);
if (data.stage === 'done') {
stager.stop();
mso.stop();
}
return Promise.resolve();
});
Expand All @@ -222,16 +222,16 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
}

if (flags.async) {
stager.goto('done', { scratchOrgInfo });
stager.stop();
mso.skipTo('done', { scratchOrgInfo });
mso.stop();
this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
} else {
this.logSuccess(messages.getMessage('success'));
}

return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
} catch (error) {
stager.stop(error as Error);
mso.error();
if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
const scratchOrgInfoId = (error.data as { scratchOrgInfoId: string }).scratchOrgInfoId;
const resumeMessage = messages.getMessage('action.resume', [this.config.bin, scratchOrgInfoId]);
Expand Down
8 changes: 4 additions & 4 deletions src/commands/org/resume/scratch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
const cached = cache.get(jobId);
const hubBaseUrl = cached?.hubBaseUrl;

const stager = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
const mso = new MultiStageOutput<ScratchOrgLifecycleEvent & { alias: string | undefined }>({
stages: scratchOrgLifecycleStages,
title: 'Resuming Scratch Org',
data: { alias: cached?.alias },
Expand Down Expand Up @@ -96,9 +96,9 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
});

lifecycle.on<ScratchOrgLifecycleEvent>(scratchOrgLifecycleEventName, async (data): Promise<void> => {
stager.goto(data.stage, data);
mso.skipTo(data.stage, data);
if (data.stage === 'done') {
stager.stop();
mso.stop();
}
return Promise.resolve();
});
Expand All @@ -109,7 +109,7 @@ export default class OrgResumeScratch extends SfCommand<ScratchCreateResponse> {
this.logSuccess(messages.getMessage('success'));
return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
} catch (e) {
stager.stop(e as Error);
mso.error();

if (cache.keys() && e instanceof Error && e.name === 'CacheMissError') {
// we have something in the cache, but it didn't match what the user passed in
Expand Down

0 comments on commit d256725

Please sign in to comment.