Skip to content

Commit

Permalink
feat: different approach
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 16, 2024
1 parent cb6a98d commit af10b81
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 19 deletions.
1 change: 0 additions & 1 deletion src/exported.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
export { toHelpSection, parseVarArgs } from './util.js';
export { Progress } from './ux/progress.js';
export { Spinner } from './ux/spinner.js';
export { MultiStageOutput } from './ux/multiStageOutput.js';
export { Ux } from './ux/ux.js';
export { StandardColors } from './ux/standardColors.js';

Expand Down
10 changes: 10 additions & 0 deletions src/sfCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
StructuredMessage,
} from '@salesforce/core';
import type { AnyJson } from '@salesforce/ts-types';
import { MultiStageOutput, MultiStageOutputOptions } from '@oclif/multi-stage-output';
import { Progress } from './ux/progress.js';
import { Spinner } from './ux/spinner.js';
import { Ux } from './ux/ux.js';
Expand Down Expand Up @@ -314,6 +315,15 @@ export abstract class SfCommand<T> extends Command {
return confirm({ message, ms, defaultAnswer });
}

public initStager<O extends Record<string, unknown>>(options: MultiStageOutputOptions<O>): MultiStageOutput<O> {
const ms = new MultiStageOutput<O>(options);
if (this.jsonEnabled()) {
ms.stop();
}

return ms;
}

public async _run<R>(): Promise<R> {
['SIGINT', 'SIGTERM', 'SIGBREAK', 'SIGHUP'].map((listener) => {
process.on(listener, () => {
Expand Down
18 changes: 0 additions & 18 deletions src/ux/multiStageOutput.ts

This file was deleted.

0 comments on commit af10b81

Please sign in to comment.