diff options
| author | Kyren223 <Kyren223@proton.me> | 2025-02-06 18:37:29 +0200 |
|---|---|---|
| committer | Kyren223 <Kyren223@proton.me> | 2025-02-06 18:37:29 +0200 |
| commit | ffb5935164568fc20ce3b803312fe0d51bfa43bf (patch) | |
| tree | e22a239c2dedabd3adf7ec2164fe4d437b2f8107 /internal/client/client.go | |
| parent | 98f29ba812f8ddc0f73ad4b1b02fc31bee42a067 (diff) | |
Added config for colors (not yet supported in most areas as I need to
make things not static so they color changes)
Diffstat (limited to 'internal/client/client.go')
| -rw-r--r-- | internal/client/client.go | 11 |
1 files changed, 10 insertions, 1 deletions
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 |
