Skip to content

Commit

Permalink
fix: stop multistage before it starts
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 16, 2024
1 parent 200ba93 commit 01f2d2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ux/multiStageOutput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

import { MultiStageOutput as OclifMultiStageOutput, MultiStageOutputOptions } from '@oclif/multi-stage-output';

/**
* This class is a light wrapper around MultiStageOutput that allows us to
* automatically suppress any actions if `--json` flag is present.
*/
export class MultiStageOutput<T extends Record<string, unknown>> extends OclifMultiStageOutput<T> {
public constructor(opts: MultiStageOutputOptions<T> & { outputEnabled: boolean }) {
if (opts.outputEnabled) super(opts);
const { outputEnabled, ...rest } = opts;
super(rest);
if (!outputEnabled) {
this.stop();
}
}
}

0 comments on commit 01f2d2b

Please sign in to comment.