From ffb5935164568fc20ce3b803312fe0d51bfa43bf Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 6 Feb 2025 18:37:29 +0200 Subject: Added config for colors (not yet supported in most areas as I need to make things not static so they color changes) --- internal/client/client.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'internal/client/client.go') diff --git a/internal/client/client.go b/internal/client/client.go index a779bf9..b0a3447 100644 --- a/internal/client/client.go +++ b/internal/client/client.go @@ -1,6 +1,7 @@ package client import ( + "fmt" "io" "log" "os" @@ -12,6 +13,7 @@ import ( "github.com/kyren223/eko/internal/client/config" "github.com/kyren223/eko/internal/client/ui" "github.com/kyren223/eko/internal/client/ui/auth" + "github.com/kyren223/eko/internal/client/ui/colors" "github.com/kyren223/eko/pkg/assert" ) @@ -38,9 +40,16 @@ func Run() { err := config.Load() if err != nil { - log.Fatalf("Config file at '%v' was unable to load successfully\n%v\n", config.ConfigFile, err) + fmt.Printf("Config file at '%v' was unable to load successfully\n%v\n", config.ConfigFile, err) + os.Exit(1) } + config.Use(func(config *config.Config) { + if config.Colors != nil { + colors.LoadStrings(config.Colors) + } + }) + program := tea.NewProgram(initialModel(dump), tea.WithAltScreen()) assert.AddFlush(BubbleTeaCloser{program}) ui.Program = program -- cgit v1.3.1