aboutsummaryrefslogtreecommitdiffstats
path: root/commands/webui.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2023-01-14 14:49:25 +0100
committerGitHub <noreply@github.com>2023-01-14 14:49:25 +0100
commit6e5ea512ac82972c6e0da78976f967006e5fe5c4 (patch)
tree7727fc721b4bd82fcf7869fb48f9656504cbb3af /commands/webui.go
parenta1eec9aadfa24bad4804edc5fbb1c0753f4690cb (diff)
parent7df34aa7a40be0d7b759ea3ef42cedf9f25f32b2 (diff)
downloadgit-bug-6e5ea512ac82972c6e0da78976f967006e5fe5c4.tar.gz
Merge pull request #987 from MichaelMure/cache-progress-bar
commands: add a nice terminal progress bar when building the cache
Diffstat (limited to 'commands/webui.go')
-rw-r--r--commands/webui.go17
1 files changed, 4 insertions, 13 deletions
diff --git a/commands/webui.go b/commands/webui.go
index 0b3b24a6..31313146 100644
--- a/commands/webui.go
+++ b/commands/webui.go
@@ -108,19 +108,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