From 21199b274fa34dc87e33ba9dd6eed713e40d66b2 Mon Sep 17 00:00:00 2001 From: Cerebrovinny Date: Sun, 5 Jan 2025 20:37:46 +0000 Subject: [PATCH] exec update theme colors --- internal/exec/vendor_model.go | 11 ++++++----- internal/exec/vendor_model_component.go | 4 ++-- internal/exec/workflow_utils.go | 8 ++++---- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/internal/exec/vendor_model.go b/internal/exec/vendor_model.go index 1209e68051..5a09468b5e 100644 --- a/internal/exec/vendor_model.go +++ b/internal/exec/vendor_model.go @@ -14,6 +14,7 @@ import ( tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "github.com/cloudposse/atmos/pkg/schema" + "github.com/cloudposse/atmos/pkg/ui/theme" u "github.com/cloudposse/atmos/pkg/utils" "github.com/hashicorp/go-getter" cp "github.com/otiai10/copy" @@ -67,11 +68,11 @@ type modelVendor struct { } var ( - currentPkgNameStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("211")) + currentPkgNameStyle = theme.Styles.PackageName doneStyle = lipgloss.NewStyle().Margin(1, 2) - checkMark = lipgloss.NewStyle().Foreground(lipgloss.Color("42")).SetString("✓") - xMark = lipgloss.NewStyle().Foreground(lipgloss.Color("9")).SetString("x") - grayColor = lipgloss.NewStyle().Foreground(lipgloss.Color("241")) + checkMark = theme.Styles.Checkmark + xMark = theme.Styles.XMark + grayColor = theme.Styles.GrayText ) func newModelAtmosVendorInternal(pkgs []pkgAtmosVendor, dryRun bool, atmosConfig schema.AtmosConfiguration) (modelVendor, error) { @@ -81,7 +82,7 @@ func newModelAtmosVendorInternal(pkgs []pkgAtmosVendor, dryRun bool, atmosConfig progress.WithoutPercentage(), ) s := spinner.New() - s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("63")) + s.Style = theme.Styles.Link if len(pkgs) == 0 { return modelVendor{done: true}, nil } diff --git a/internal/exec/vendor_model_component.go b/internal/exec/vendor_model_component.go index 38671b190f..6502936d00 100644 --- a/internal/exec/vendor_model_component.go +++ b/internal/exec/vendor_model_component.go @@ -11,8 +11,8 @@ import ( "github.com/charmbracelet/bubbles/progress" "github.com/charmbracelet/bubbles/spinner" tea "github.com/charmbracelet/bubbletea" - "github.com/charmbracelet/lipgloss" "github.com/cloudposse/atmos/pkg/schema" + "github.com/cloudposse/atmos/pkg/ui/theme" "github.com/hashicorp/go-getter" cp "github.com/otiai10/copy" ) @@ -37,7 +37,7 @@ func newModelComponentVendorInternal(pkgs []pkgComponentVendor, dryRun bool, atm progress.WithoutPercentage(), ) s := spinner.New() - s.Style = lipgloss.NewStyle().Foreground(lipgloss.Color("63")) + s.Style = theme.Styles.Link if len(pkgs) == 0 { return modelVendor{done: true}, nil } diff --git a/internal/exec/workflow_utils.go b/internal/exec/workflow_utils.go index 06fdd53faa..971a063964 100644 --- a/internal/exec/workflow_utils.go +++ b/internal/exec/workflow_utils.go @@ -7,12 +7,12 @@ import ( "sort" "strings" - "github.com/fatih/color" "github.com/pkg/errors" "github.com/samber/lo" w "github.com/cloudposse/atmos/internal/tui/workflow" "github.com/cloudposse/atmos/pkg/schema" + "github.com/cloudposse/atmos/pkg/ui/theme" u "github.com/cloudposse/atmos/pkg/utils" ) @@ -109,12 +109,12 @@ func ExecuteWorkflow( workflowFileName := filepath.Base(workflowPath) workflowFileName = strings.TrimSuffix(workflowFileName, filepath.Ext(workflowFileName)) - failedMsg := color.New(color.FgRed).Sprintf("\nStep '%s' failed!", step.Name) + failedMsg := theme.Colors.Error.Sprintf("\nStep '%s' failed!", step.Name) u.LogDebug(atmosConfig, fmt.Sprintf("\nCommand failed: %s", command)) u.LogDebug(atmosConfig, fmt.Sprintf("Error: %v", err)) - resumeMsg := color.New(color.FgGreen).Sprintf( + resumeMsg := theme.Colors.Success.Sprintf( "\nTo resume the workflow from this step, run:\natmos workflow %s -f %s --from-step %s", workflow, workflowFileName, @@ -256,7 +256,7 @@ func ExecuteWorkflowUI(atmosConfig schema.AtmosConfiguration) (string, string, s fmt.Println() u.PrintMessageInColor(fmt.Sprintf( "Executing command:\n"+os.Args[0]+" workflow %s --file %s --from-step \"%s\"\n", selectedWorkflow, selectedWorkflowFile, selectedWorkflowStep), - color.New(color.FgCyan), + theme.Colors.Info, ) fmt.Println()