Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
VERSION = 0.0.1
BUILD ?=$(shell git rev-parse --short HEAD)
PKG ?=github.com/commitdev/commit0
BUILD_ARGS=-v -ldflags=all="-X ${PKG}/cmd.appVersion=${VERSION} -X ${PKG}/cmd.appBuild=${BUILD}"

check:
go test ./...

Expand All @@ -13,7 +18,7 @@ build-example-docker: clean-example
docker run -v "$(shell pwd)/example/hello-world:/project" --user $(shell id -u):$(shell id -g) commit0:v0 generate -l go

build:
go build -o commit0
go build ${BUILD_ARGS}

# Installs the CLI int your GOPATH
install-go:
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,11 @@ import (
"github.com/spf13/cobra"
)

var (
appVersion = "SNAPSHOT"
appBuild = "SNAPSHOT"
)

func init() {
rootCmd.AddCommand(versionCmd)
}
Expand All @@ -14,6 +19,7 @@ var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of commit0",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("v0.0.0") // Updated via updateVersion.sh
fmt.Printf("version: %v\n", appVersion)
fmt.Printf("build: %v\n", appBuild)
},
}
12 changes: 0 additions & 12 deletions updateVersion.sh

This file was deleted.