forked from coop-cloud/go-abra
feat: added version and makefile
makefile allows for package variables to be defined
This commit is contained in:
parent
a7d748cb1f
commit
a2a836c2a9
|
@ -0,0 +1,5 @@
|
|||
COMMIT := $(shell git rev-list -1 HEAD)
|
||||
VERSION := $(shell cat ./version)
|
||||
|
||||
run:
|
||||
go run -ldflags="-X 'main.Commit=$(COMMIT)' -X 'main.Version=$(VERSION)'" ./cmd/abra
|
|
@ -8,11 +8,14 @@ import (
|
|||
"github.com/urfave/cli/v2"
|
||||
)
|
||||
|
||||
var Version string
|
||||
var Commit string
|
||||
|
||||
func main() {
|
||||
app := &cli.App{
|
||||
Name: "abra",
|
||||
Usage: "The cooperative cloud utility belt 🎩🐇",
|
||||
Version: "TBA",
|
||||
Version: fmt.Sprintf("%s-%s", Version, Commit[:7]),
|
||||
Commands: []*cli.Command{
|
||||
{
|
||||
Name: "server",
|
||||
|
|
Reference in New Issue