File tree Expand file tree Collapse file tree 3 files changed +13
-14
lines changed
Expand file tree Collapse file tree 3 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1+ VERSION = 0.0.1
2+ BUILD ?=$(shell git rev-parse --short HEAD)
3+ PKG ?=github.com/commitdev/commit0
4+ BUILD_ARGS =-v -ldflags=all="-X ${PKG}/cmd.appVersion=${VERSION} -X ${PKG}/cmd.appBuild=${BUILD}"
5+
16check :
27 go test ./...
38
@@ -13,7 +18,7 @@ build-example-docker: clean-example
1318 docker run -v " $( shell pwd) /example/hello-world:/project" --user $(shell id -u) :$(shell id -g) commit0:v0 generate -l go
1419
1520build :
16- go build -o commit0
21+ go build ${BUILD_ARGS}
1722
1823# Installs the CLI int your GOPATH
1924install-go :
Original file line number Diff line number Diff line change @@ -6,6 +6,11 @@ import (
66 "github.com/spf13/cobra"
77)
88
9+ var (
10+ appVersion = "SNAPSHOT"
11+ appBuild = "SNAPSHOT"
12+ )
13+
914func init () {
1015 rootCmd .AddCommand (versionCmd )
1116}
@@ -14,6 +19,7 @@ var versionCmd = &cobra.Command{
1419 Use : "version" ,
1520 Short : "Print the version number of commit0" ,
1621 Run : func (cmd * cobra.Command , args []string ) {
17- fmt .Println ("v0.0.0" ) // Updated via updateVersion.sh
22+ fmt .Printf ("version: %v\n " , appVersion )
23+ fmt .Printf ("build: %v\n " , appBuild )
1824 },
1925}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments