diff options
Diffstat (limited to 'commands/webui.go')
-rw-r--r-- | commands/webui.go | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/commands/webui.go b/commands/webui.go index 0b3b24a6..3129a222 100644 --- a/commands/webui.go +++ b/commands/webui.go @@ -42,8 +42,7 @@ type webUIOptions struct { query string } -func newWebUICommand() *cobra.Command { - env := execenv.NewEnv() +func newWebUICommand(env *execenv.Env) *cobra.Command { options := webUIOptions{} cmd := &cobra.Command{ @@ -108,19 +107,10 @@ func runWebUI(env *execenv.Env, opts webUIOptions) error { mrc := cache.NewMultiRepoCache() _, events := mrc.RegisterDefaultRepository(env.Repo) - for event := range events { - if event.Err != nil { - env.Err.Printf("Cache building error [%s]: %v\n", event.Typename, event.Err) - continue - } - switch event.Event { - case cache.BuildEventCacheIsBuilt: - env.Err.Println("Building cache... ") - case cache.BuildEventStarted: - env.Err.Printf("[%s] started\n", event.Typename) - case cache.BuildEventFinished: - env.Err.Printf("[%s] done\n", event.Typename) - } + + err := execenv.CacheBuildProgressBar(env, events) + if err != nil { + return err } var errOut io.Writer |