From e6489ac741997d9aed8c39b722ac02cfe0166ca5 Mon Sep 17 00:00:00 2001 From: Kim Pepper Date: Mon, 31 Aug 2026 12:29:41 +1000 Subject: [PATCH 1/2] fix: wire up GitVersion for skpr --version flag --- cmd/skpr/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/skpr/main.go b/cmd/skpr/main.go index e8400f4..e6a5056 100644 --- a/cmd/skpr/main.go +++ b/cmd/skpr/main.go @@ -164,7 +164,7 @@ func main() { }) } - if err := fang.Execute(context.Background(), cmd, fang.WithColorSchemeFunc(MyColorScheme)); err != nil { + if err := fang.Execute(context.Background(), cmd, fang.WithColorSchemeFunc(MyColorScheme), fang.WithVersion(version.GitVersion)); err != nil { os.Exit(1) } } From 25812bdf3cd0e9c8ee8c40a1b8553d5be12f3c85 Mon Sep 17 00:00:00 2001 From: Kim Pepper Date: Mon, 31 Aug 2026 12:46:25 +1000 Subject: [PATCH 2/2] fix: stamp GitVersion in local mise build The build task referenced a variable that didn't match the one defined in the env block (LGFLAGS vs LDFLAGS), so ldflags were never applied and GitVersion was never set for local builds. --- .mise.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.mise.toml b/.mise.toml index 9134296..75115f0 100644 --- a/.mise.toml +++ b/.mise.toml @@ -6,7 +6,6 @@ go = "1.26" [env] CGO_ENABLED=0 -LGFLAGS="-extldflags '-static'" SKPR_API="localhost:50051?insecure=true" SKPR_SSH="localhost:2222" SKPR_PROJECT="drupal" @@ -24,9 +23,10 @@ run = "go mod tidy" [tasks.build] description = "Build the application" run = ''' -go build -o bin/skpr -ldflags=${CLI_LDFLAGS} github.com/skpr/cli/cmd/skpr -go build -o bin/skpr-agent -ldflags=${CLI_LDFLAGS} github.com/skpr/cli/cmd/skpr-agent -go build -o bin/skpr-rsh -ldflags=${CLI_LDFLAGS} github.com/skpr/cli/cmd/skpr-rsh +LDFLAGS="-extldflags '-static' -X github.com/skpr/cli/cmd/skpr/version.GitVersion=$(git describe --tags --always --dirty) -X github.com/skpr/cli/cmd/skpr/version.BuildDate=$(date +%Y-%m-%d)" +go build -o bin/skpr -ldflags="${LDFLAGS}" github.com/skpr/cli/cmd/skpr +go build -o bin/skpr-agent -ldflags="${LDFLAGS}" github.com/skpr/cli/cmd/skpr-agent +go build -o bin/skpr-rsh -ldflags="${LDFLAGS}" github.com/skpr/cli/cmd/skpr-rsh ''' depends = ["vendor"]