mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-27 11:33:33 +00:00
feat(version): replace --version with 'version' command to print build information for uc and uncloudd
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user