Skip to content
This repository has been archived by the owner on Aug 6, 2024. It is now read-only.

Commit

Permalink
renames versionTag to versionGitHash
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Setale <[email protected]>
  • Loading branch information
koalalorenzo committed Oct 12, 2020
1 parent 5cf07e1 commit 99badcb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ GO_BUILD_OUT_FILE ?= build/backpack
.DEFAULT_GOAL := build

ifneq (${VERSION},)
BUILD_LDFLAGS := -X ${_GO_PACKAGE}/cmd.version=${VERSION} -X ${_GO_PACKAGE}/cmd.versionTag=${GIT_COMMIT_SHORT}
BUILD_LDFLAGS := -X ${_GO_PACKAGE}/cmd.version=${VERSION} -X ${_GO_PACKAGE}/cmd.versionGitHash=${GIT_COMMIT_SHORT}
endif
BUILD_LDFLAGS ?= -X ${_GO_PACKAGE}/cmd.versionTag=${GIT_COMMIT_SHORT}
BUILD_LDFLAGS ?= -X ${_GO_PACKAGE}/cmd.versionGitHash=${GIT_COMMIT_SHORT}

clean:
rm -rf vendor
Expand Down
3 changes: 0 additions & 3 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import (
)

var (
// Specify a version and versionTag
version = "unstable"
versionTag = "HEAD"
// rootCmd represents the base command when called without any subcommands
rootCmd = &cobra.Command{
Use: "backpack",
Expand Down
8 changes: 7 additions & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ import (
"github.com/spf13/cobra"
)

var (
// Specify a version and versionTag
version = "unstable"
versionGitHash = "HEAD"
)

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Expand All @@ -18,6 +24,6 @@ func init() {
}

func versionRun(cmd *cobra.Command, args []string) {
fmt.Printf("Backpack version: %s (%s)\n", version, versionTag)
fmt.Printf("Backpack version: %s (%s)\n", version, versionGitHash)
fmt.Println("More info: https://backpack.qm64.tech")
}

0 comments on commit 99badcb

Please sign in to comment.