Skip to content

Commit af630ac

Browse files
committed
fix: Addressing regressions from charm updates
1 parent f0abebb commit af630ac

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

internal/cli/commands/catalog/tui/tui.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import (
1414

1515
func Run(ctx context.Context, l log.Logger, opts *options.TerragruntOptions, svc catalog.CatalogService) error {
1616
if _, err := tea.NewProgram(NewModel(l, opts, svc), tea.WithContext(ctx)).Run(); err != nil {
17-
if err := context.Cause(ctx); errors.Is(err, context.Canceled) {
17+
if cause := context.Cause(ctx); errors.Is(cause, context.Canceled) {
1818
return nil
19-
} else if err != nil {
20-
return err
19+
} else if cause != nil {
20+
return cause
2121
}
2222

2323
return err

internal/cli/commands/catalog/tui/update.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package tui
22

33
import (
44
"fmt"
5+
"os"
56

67
"charm.land/bubbles/v2/key"
78
"charm.land/bubbles/v2/list"
@@ -40,8 +41,13 @@ func updateList(msg tea.Msg, m Model) (tea.Model, tea.Cmd) { //nolint:gocritic
4041
var content string
4142

4243
if selectedModule.IsMarkDown() {
44+
style := "dark"
45+
if !lipgloss.HasDarkBackground(os.Stdin, os.Stdout) {
46+
style = "light"
47+
}
48+
4349
renderer, err := glamour.NewTermRenderer(
44-
glamour.WithStandardStyle("dark"),
50+
glamour.WithStandardStyle(style),
4551
glamour.WithWordWrap(m.width),
4652
)
4753
if err != nil {

0 commit comments

Comments
 (0)