From 7a87231d54558afa4679f8fdd6fd413123cf5b58 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 17 May 2024 20:12:02 +0200 Subject: build: enable versioning of package --- searchix.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'searchix.go') diff --git a/searchix.go b/searchix.go index 6a984ee..ba33e3f 100644 --- a/searchix.go +++ b/searchix.go @@ -52,7 +52,11 @@ func nextOccurrenceOfLocalTime(t toml.LocalTime) time.Time { func main() { flag.Parse() if *version { - fmt.Fprintln(os.Stderr, "searchix", buildVersion, config.CommitSHA) + fmt.Fprintf(os.Stderr, "searchix %s", buildVersion) + if buildVersion != config.CommitSHA && buildVersion != config.ShortSHA { + fmt.Fprintf(os.Stderr, " %s", config.CommitSHA) + } + fmt.Fprint(os.Stderr, "\n") os.Exit(0) } -- cgit 1.4.1