feat(version): replace --version with 'version' command to print build information for uc and uncloudd

This commit is contained in:
Pasha Sviderski
2026-05-21 15:14:08 +10:00
parent 28c88e4e10
commit 2f159157cc
8 changed files with 194 additions and 17 deletions
+1
View File
@@ -19,6 +19,7 @@ var (
BoldYellow = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Yellow)
NameStyle = lipgloss.NewStyle().Bold(true).Foreground(lipgloss.Color("152"))
URLStyle = lipgloss.NewStyle().Underline(true).Foreground(lipgloss.BrightBlue)
)
// FormatImage renders an image reference with the given style, using a faint colon separator for tagged images.
+12 -6
View File
@@ -9,12 +9,11 @@ import (
goversion "github.com/caarlos0/go-version"
)
func String() string {
if version == "" {
return "999.0.0-dev"
}
return version
}
const (
WebsiteURL = "https://uncloud.run"
DocsURL = "https://uncloud.run/docs"
DiscordURL = "https://uncloud.run/discord"
)
// Build-time metadata injected via -ldflags by GoReleaser (see .goreleaser.yaml).
// These are package-level so the same paths can be referenced from any binary's ldflags.
@@ -26,6 +25,13 @@ var (
builtBy string
)
func String() string {
if version == "" {
return "999.0.0-dev"
}
return version
}
// Info holds version and build metadata for an Uncloud binary.
type Info struct {
Version string