From 7df34aa7a40be0d7b759ea3ef42cedf9f25f32b2 Mon Sep 17 00:00:00 2001 From: Michael Muré Date: Tue, 10 Jan 2023 21:36:03 +0100 Subject: commands: add a nice terminal progress bar when building the cache One issue remaining is that writing the cache takes significant time, but I don't know how to reflect that nicely to the user. --- commands/execenv/env_testing.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'commands/execenv/env_testing.go') diff --git a/commands/execenv/env_testing.go b/commands/execenv/env_testing.go index 34eafc9c..6eb9c69d 100644 --- a/commands/execenv/env_testing.go +++ b/commands/execenv/env_testing.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "io" "testing" "github.com/stretchr/testify/require" @@ -12,6 +13,8 @@ import ( "github.com/MichaelMure/git-bug/repository" ) +var _ Out = &TestOut{} + type TestOut struct { *bytes.Buffer } @@ -37,6 +40,10 @@ func (te *TestOut) PrintJSON(v interface{}) error { return nil } +func (te *TestOut) Raw() io.Writer { + return te.Buffer +} + func NewTestEnv(t *testing.T) *Env { t.Helper() -- cgit