Skip to content

Commit 8c40fa8

Browse files
author
Doug Hatcher
committed
version command
1 parent c21ee60 commit 8c40fa8

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ifeq (run,$(firstword $(MAKECMDGOALS)))
66
endif
77

88
VERSION := $(shell git tag | grep ^v | sort -V | tail -n 1)
9-
LDFLAGS = -ldflags "-X main.Version=${VERSION}"
9+
LDFLAGS = -ldflags "-X main.version=${VERSION}"
1010

1111
.PHONY: help
1212

main.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@ var testMode = false
3535

3636
var tempDir string = "./" + configDir + "/tmp"
3737

38-
var Version string = ""
38+
var (
39+
version = "dev"
40+
commit = "none"
41+
date = "unknown"
42+
builtBy = "unknown"
43+
)
3944

4045
func main() {
4146

4247
// output version info
4348
if len(os.Args) > 1 {
4449
arg := os.Args[1]
4550
if arg == "version" {
46-
fmt.Println("Magento CLI by Blue Acorn iCi x Infosys " + Version)
51+
fmt.Println("Magento CLI by Blue Acorn iCi x Infosys " + version)
4752
os.Exit(0)
4853
}
4954
}

0 commit comments

Comments
 (0)