From 35f0d0d7f9a879a64e2683d399c1b7e01ee54d06 Mon Sep 17 00:00:00 2001 From: Ian Stahnke <3182572+pr8kerl@users.noreply.github.com> Date: Sat, 10 Aug 2019 13:30:21 +1000 Subject: [PATCH] version shows goreleaser build --- .goreleaser.yml | 2 ++ pkg/cmd/version.go | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index cc8be46..147210b 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -14,6 +14,8 @@ builds: goarch: - amd64 binary: kubectl-ssm_secret + ldflags: + - -s -w -X github.com/pr8kerl/kubectl-ssm-secret/pkg/cmd.version={{.Version}} archives: - replacements: darwin: darwin diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go index f067acf..78b803d 100644 --- a/pkg/cmd/version.go +++ b/pkg/cmd/version.go @@ -6,10 +6,12 @@ import ( "github.com/spf13/cobra" ) +var version string = "snapshot" + var versionCmd = &cobra.Command{ Use: "version", Short: "print the ssm-secret version", Run: func(cmd *cobra.Command, args []string) { - fmt.Println("ssm-secret v1.0.0") + fmt.Println(fmt.Sprintf("ssm-secret v%s", version)) }, }