diff --git a/src/multi-stage-output.tsx b/src/multi-stage-output.tsx index 415911d..9689256 100644 --- a/src/multi-stage-output.tsx +++ b/src/multi-stage-output.tsx @@ -68,6 +68,10 @@ export type MultiStageOutputOptions> = { * Design options to customize the output. */ readonly design?: Design + /** + * Set to true when --json flag is passed to the command. This will prevent any output to the console. Defaults to false + */ + readonly jsonEnabled: boolean } class CIMultiStageOutput> { @@ -234,6 +238,7 @@ export class MultiStageOutput> implements Disp public constructor({ data, design, + jsonEnabled = false, postStagesBlock, preStagesBlock, showElapsedTime, @@ -255,10 +260,13 @@ export class MultiStageOutput> implements Disp this.stageTracker = new StageTracker(stages) this.stageSpecificBlock = stageSpecificBlock + if (jsonEnabled) return + if (isInCi) { this.ciInstance = new CIMultiStageOutput({ data, design, + jsonEnabled, postStagesBlock, preStagesBlock, showElapsedTime,