feat: added version and makefile

makefile allows for package variables to be defined
This commit is contained in:
Roxie Gibson 2021-07-13 23:47:47 +01:00
parent a7d748cb1f
commit a2a836c2a9
Signed by untrusted user: roxxers
GPG Key ID: 5D0140EDEE123F4D
3 changed files with 10 additions and 1 deletions

5
Makefile Normal file
View File

@ -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

View File

@ -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",

1
version Normal file
View File

@ -0,0 +1 @@
1.0.0a