diff options
author | Michael Muré <batolettre@gmail.com> | 2022-12-19 18:09:59 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2022-12-19 18:09:59 +0100 |
commit | f2def3a9331080a02e57710a859d2aac608ed44c (patch) | |
tree | 2697224efb96110b65489877b5ba7d67d508eb5e /commands | |
parent | 60d40d60e9f91247b61f541888f1469bff44f573 (diff) | |
download | git-bug-f2def3a9331080a02e57710a859d2aac608ed44c.tar.gz |
WIP
Diffstat (limited to 'commands')
-rw-r--r-- | commands/execenv/env.go | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/commands/execenv/env.go b/commands/execenv/env.go index a63f835a..4b353279 100644 --- a/commands/execenv/env.go +++ b/commands/execenv/env.go @@ -128,11 +128,30 @@ func LoadBackend(env *Env) func(*cobra.Command, []string) error { return err } - env.Backend, err = cache.NewRepoCache(env.Repo) + var events chan cache.BuildEvent + env.Backend, events, err = cache.NewRepoCache(env.Repo) if err != nil { return err } + if events != nil { + _, _ = fmt.Fprintln(os.Stderr, "Building cache... ") + } + + for event := range events { + if event.Err != nil { + _, _ = fmt.Fprintf(os.Stderr, "Cache building error [%s]: %v\n", event.Typename, event.Err) + continue + } + + switch event.Event { + case cache.BuildEventStarted: + _, _ = fmt.Fprintf(os.Stderr, "[%s] started\n", event.Typename) + case cache.BuildEventFinished: + _, _ = fmt.Fprintf(os.Stderr, "[%s] done\n", event.Typename) + } + } + cleaner := func(env *Env) interrupt.CleanerFunc { return func() error { if env.Backend != nil { |