centralize index progress bar for termstatus

This commit is contained in:
Michael Eischer
2025-09-15 20:25:17 +02:00
parent 6cdb9a75e6
commit 32b7168a9e
8 changed files with 29 additions and 12 deletions
+5 -1
View File
@@ -252,7 +252,7 @@ func runCheck(ctx context.Context, opts CheckOptions, gopts GlobalOptions, args
}
printer.P("load indexes\n")
bar := newIndexTerminalProgress(gopts.Quiet, gopts.JSON, term)
bar := newIndexTerminalProgress(printer)
hints, errs := chkr.LoadIndex(ctx, bar)
if ctx.Err() != nil {
return summary, ctx.Err()
@@ -528,6 +528,10 @@ func (*jsonErrorPrinter) NewCounter(_ string) *progress.Counter {
return nil
}
func (*jsonErrorPrinter) NewCounterTerminalOnly(_ string) *progress.Counter {
return nil
}
func (p *jsonErrorPrinter) E(msg string, args ...interface{}) {
status := checkError{
MessageType: "error",