diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 32babcd..1072cf3 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -15,6 +15,9 @@ builds: - linux - windows - darwin + ldflags: + - -s -w + -X github.com/viveksinghggits/akcess/cmd.VERSION={{.Version}} archives: - replacements: darwin: Darwin diff --git a/cmd/root.go b/cmd/root.go index eb9c923..2fcbe1a 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -55,6 +55,8 @@ var ( options = &utils.AllowOptions{} res = []string{} delIdentifier string + // VERSION will be overriden by ldflags when we build the project using goreleaser + VERSION = "DEV" ) func init() { @@ -79,7 +81,7 @@ var versionCmd = &cobra.Command{ Use: "version", Short: fmt.Sprintf("Print the version of %s", utils.Name), Run: func(cmd *cobra.Command, args []string) { - fmt.Println("akcess 0.0.1") + fmt.Println(VERSION) }, }