From ad8f7937b1fb92125b55c94d265c46d0d3159bd0 Mon Sep 17 00:00:00 2001 From: Oliver Jakoubek Date: Thu, 5 Mar 2026 11:35:58 +0100 Subject: [PATCH] fix: use time.Now() for BuildDate instead of shell date command (Windows-kompatibel) --- magefiles/magefile.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/magefiles/magefile.go b/magefiles/magefile.go index 0184f1f..4cbb769 100644 --- a/magefiles/magefile.go +++ b/magefiles/magefile.go @@ -7,6 +7,7 @@ import ( "os" "path/filepath" "runtime" + "time" "github.com/magefile/mage/mg" "github.com/magefile/mage/sh" @@ -23,10 +24,7 @@ func ldflags() (string, error) { if err != nil { commit = "none" } - buildDate, err := sh.Output("date", "-u", "+%Y-%m-%dT%H:%M:%SZ") - if err != nil { - buildDate = "unknown" - } + buildDate := time.Now().UTC().Format(time.RFC3339) return fmt.Sprintf( `-X code.beautifulmachines.dev/jakoubek/csv2excel/internal/version.Version=%s -X code.beautifulmachines.dev/jakoubek/csv2excel/internal/version.Commit=%s -X code.beautifulmachines.dev/jakoubek/csv2excel/internal/version.BuildDate=%s`, version, commit, buildDate,