@@ -18,7 +18,6 @@ import {
1818import { Flags , SfCommand } from '@salesforce/sf-plugins-core' ;
1919import { Duration } from '@salesforce/kit' ;
2020import terminalLink from 'terminal-link' ;
21- import { MultiStageOutput } from '@oclif/multi-stage-output' ;
2221import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js' ;
2322import { ScratchCreateResponse } from '../../../shared/orgTypes.js' ;
2423
@@ -171,10 +170,9 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
171170 flags [ 'client-id' ] ? await this . secretPrompt ( { message : messages . getMessage ( 'prompt.secret' ) } ) : undefined
172171 ) ;
173172
174- const ms = new MultiStageOutput < ScratchOrgLifecycleEvent & { alias : string | undefined } > ( {
173+ const stager = this . initStager < ScratchOrgLifecycleEvent & { alias : string | undefined } > ( {
175174 stages : flags . async ? [ 'prepare request' , 'send request' , 'done' ] : scratchOrgLifecycleStages ,
176175 title : flags . async ? 'Creating Scratch Org (async)' : 'Creating Scratch Org' ,
177- jsonEnabled : this . jsonEnabled ( ) ,
178176 data : { alias : flags . alias } ,
179177 postStagesBlock : [
180178 {
@@ -207,9 +205,9 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
207205 } ) ;
208206
209207 lifecycle . on < ScratchOrgLifecycleEvent > ( scratchOrgLifecycleEventName , async ( data ) : Promise < void > => {
210- ms . goto ( data . stage , data ) ;
208+ stager . goto ( data . stage , data ) ;
211209 if ( data . stage === 'done' ) {
212- ms . stop ( ) ;
210+ stager . stop ( ) ;
213211 }
214212 return Promise . resolve ( ) ;
215213 } ) ;
@@ -222,16 +220,16 @@ export default class OrgCreateScratch extends SfCommand<ScratchCreateResponse> {
222220 }
223221
224222 if ( flags . async ) {
225- ms . goto ( 'done' , { scratchOrgInfo } ) ;
226- ms . stop ( ) ;
223+ stager . goto ( 'done' , { scratchOrgInfo } ) ;
224+ stager . stop ( ) ;
227225 this . info ( messages . getMessage ( 'action.resume' , [ this . config . bin , scratchOrgInfo . Id ] ) ) ;
228226 } else {
229227 this . logSuccess ( messages . getMessage ( 'success' ) ) ;
230228 }
231229
232230 return { username, scratchOrgInfo, authFields, warnings, orgId : authFields ?. orgId } ;
233231 } catch ( error ) {
234- ms . stop ( error as Error ) ;
232+ stager . stop ( error as Error ) ;
235233 if ( error instanceof SfError && error . name === 'ScratchOrgInfoTimeoutError' ) {
236234 const scratchOrgInfoId = ( error . data as { scratchOrgInfoId : string } ) . scratchOrgInfoId ;
237235 const resumeMessage = messages . getMessage ( 'action.resume' , [ this . config . bin , scratchOrgInfoId ] ) ;
0 commit comments