refactor: format deployment plan for caddy (uc caddy deploy)

This commit is contained in:
Pasha Sviderski
2026-03-19 14:22:01 +10:00
parent e4cb71b878
commit b4b1232375
4 changed files with 138 additions and 31 deletions
+14 -1
View File
@@ -1,6 +1,9 @@
package tui
import "charm.land/lipgloss/v2"
import (
"charm.land/lipgloss/v2"
"github.com/distribution/reference"
)
var (
Faint = lipgloss.NewStyle().Faint(true)
@@ -15,3 +18,13 @@ var (
NameStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("152"))
)
// FormatImage renders an image reference with the given style, using a faint colon separator for tagged images.
func FormatImage(image reference.Named, style lipgloss.Style) string {
if tagged, ok := image.(reference.NamedTagged); ok {
return style.Render(reference.FamiliarName(image)) +
Faint.Render(":") +
style.Render(tagged.Tag())
}
return style.Render(reference.FamiliarString(image))
}