Skip to content

Commit c89f301

Browse files
ndeloofglours
authored andcommitted
force plain displaymode if stdout isn't a terminal
Signed-off-by: Nicolas De Loof <[email protected]>
1 parent 41a9b91 commit c89f301

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pkg/compose/build_bake.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ type buildStatus struct {
130130
func (s *composeService) doBuildBake(ctx context.Context, project *types.Project, serviceToBeBuild types.Services, options api.BuildOptions) (map[string]string, error) { //nolint:gocyclo
131131
eg := errgroup.Group{}
132132
ch := make(chan *client.SolveStatus)
133-
display, err := progressui.NewDisplay(os.Stdout, progressui.DisplayMode(options.Progress))
133+
out := s.dockerCli.Out()
134+
displayMode := progressui.DisplayMode(options.Progress)
135+
if !out.IsTerminal() {
136+
displayMode = progressui.PlainMode
137+
}
138+
display, err := progressui.NewDisplay(out, displayMode)
134139
if err != nil {
135140
return nil, err
136141
}

0 commit comments

Comments
 (0)