Updated makefile to include git commit

This commit is contained in:
Carlos Salguero
2019-09-07 16:16:44 -03:00
parent 8af89a638d
commit 737c5de9af
5 changed files with 47 additions and 38 deletions

View File

@@ -38,9 +38,10 @@ const (
)
var (
Build string = "01-01-1980"
GoVersion string = "1.8"
Version string = "3.0.1"
Build string = "01-01-1980" //nolint
GoVersion string = "1.8" //nolint
Version string = "3.0.1" //nolint
Commit string //nolint
)
type cliOptions struct {
@@ -90,6 +91,7 @@ func main() {
fmt.Println(TOOLNAME)
fmt.Printf("Version %s\n", Version)
fmt.Printf("Build: %s using %s\n", Build, GoVersion)
fmt.Printf("Commit: %s\n", Commit)
return
}
@@ -98,10 +100,8 @@ func main() {
advice, err := versioncheck.CheckUpdates(TOOLNAME, Version)
if err != nil {
log.Infof("cannot check version updates: %s", err.Error())
} else {
if advice != "" {
log.Warn(advice)
}
} else if advice != "" {
log.Warn(advice)
}
}