Skip to content

Commit

Permalink
feat: add back jsonEnabled prop
Browse files Browse the repository at this point in the history
  • Loading branch information
mdonnalley committed Aug 19, 2024
1 parent 7956064 commit 65c0d00
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/multi-stage-output.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ export type MultiStageOutputOptions<T extends Record<string, unknown>> = {
* 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<T extends Record<string, unknown>> {
Expand Down Expand Up @@ -234,6 +238,7 @@ export class MultiStageOutput<T extends Record<string, unknown>> implements Disp
public constructor({
data,
design,
jsonEnabled = false,
postStagesBlock,
preStagesBlock,
showElapsedTime,
Expand All @@ -255,10 +260,13 @@ export class MultiStageOutput<T extends Record<string, unknown>> 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,
Expand Down

0 comments on commit 65c0d00

Please sign in to comment.