Skip to content

Commit

Permalink
exec update theme colors
Browse files Browse the repository at this point in the history
  • Loading branch information
Cerebrovinny committed Jan 5, 2025
1 parent 0ea3afd commit 21199b2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
11 changes: 6 additions & 5 deletions internal/exec/vendor_model.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) {
Expand All @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions internal/exec/vendor_model_component.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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
}
Expand Down
8 changes: 4 additions & 4 deletions internal/exec/workflow_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 21199b2

Please sign in to comment.