diff options
author | mjarkk <mkopenga@gmail.com> | 2021-07-27 15:00:37 +0200 |
---|---|---|
committer | mjarkk <mkopenga@gmail.com> | 2021-07-30 15:14:46 +0200 |
commit | 79848087bccd5c87af1dbb44a39753aad1346f8b (patch) | |
tree | 07e4b6eb4b7ed5fdcbde8d697a214b647ddd0536 /test | |
parent | a3b820fb5f20f4a24028ecbf285d54bbaa7b6974 (diff) |
Switch to github.com/gookit/color for terminal colors
Diffstat (limited to 'test')
-rw-r--r-- | test/lazyintegration/main.go | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/test/lazyintegration/main.go b/test/lazyintegration/main.go index f7ad91414..c86442417 100644 --- a/test/lazyintegration/main.go +++ b/test/lazyintegration/main.go @@ -7,8 +7,8 @@ import ( "os/exec" "path/filepath" - "github.com/fatih/color" "github.com/jesseduffield/gocui" + "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/integration" "github.com/jesseduffield/lazygit/pkg/secureexec" ) @@ -287,7 +287,7 @@ func (app *App) runSubprocess(cmd *exec.Cmd) { cmd.Stderr = nil cmd.Stdout = nil - fmt.Fprintf(os.Stdout, "\n%s", coloredString("press enter to return", color.FgGreen)) + fmt.Fprintf(os.Stdout, "\n%s", style.FgGreen.Sprint("press enter to return")) fmt.Scanln() // wait for enter press if err := gocui.Screen.Resume(); err != nil { @@ -382,14 +382,3 @@ func (app *App) layout(g *gocui.Gui) error { func quit(g *gocui.Gui, v *gocui.View) error { return gocui.ErrQuit } - -func coloredString(str string, colorAttributes ...color.Attribute) string { - colour := color.New(colorAttributes...) - return coloredStringDirect(str, colour) -} - -// coloredStringDirect used for aggregating a few color attributes rather than -// just sending a single one -func coloredStringDirect(str string, colour *color.Color) string { - return colour.SprintFunc()(fmt.Sprint(str)) -} |