Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/output/interactive_display.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type displayer interface {
Update(targets []buildingTarget)
Close()
Frequency() time.Duration
ShowInitialUpdate() bool
}

func setupDisplayer(state *core.BuildState, progress Progress, plain bool) displayer {
Expand Down Expand Up @@ -81,6 +82,10 @@ func (d *plainDisplay) Frequency() time.Duration {

func (d *plainDisplay) Close() {}

func (d *plainDisplay) ShowInitialUpdate() bool {
return false
}

type interactiveDisplay struct {
state *core.BuildState
progress Progress
Expand All @@ -102,6 +107,10 @@ func (d *interactiveDisplay) Frequency() time.Duration {
return 50 * time.Millisecond
}

func (d *interactiveDisplay) ShowInitialUpdate() bool {
return true
}

func (d *interactiveDisplay) Update(targets []buildingTarget) {
d.maxRows, d.maxCols = cli.CurrentBackend.MaxDimensions()
d.moveToFirstLine()
Expand Down
4 changes: 3 additions & 1 deletion src/output/shell_output.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ func MonitorState(state *core.BuildState, progress Progress, results <-chan *cor
t := time.NewTicker(displayer.Frequency())
defer t.Stop()
bt := newBuildingTargets(state, progress, plainOutput)
displayer.Update(bt.Targets())
if displayer.ShowInitialUpdate() {
displayer.Update(bt.Targets())
}
loop:
for {
select {
Expand Down
Loading