commit 9f645a7849d192aa905410d1b5bf625b363ee677 parent 35d2359bb90c4ec5b36200c2f170c04d27b353e6 Author: Sean Enck <sean@ttypty.com> Date: Wed, 8 Mar 2023 18:40:08 -0500 removing version concepts and replacing with git variant Diffstat:
| M | Makefile | | | 6 | +++++- |
| M | cmd/vers.txt | | | 4 | ++-- |
| D | internal/scripts/version/main.go | | | 10 | ---------- |
3 files changed, 7 insertions(+), 13 deletions(-)
diff --git a/Makefile b/Makefile @@ -7,9 +7,13 @@ all: $(TARGET) build: $(TARGET) $(TARGET): cmd/main.go internal/**/*.go go.* internal/cli/completions* - go run internal/scripts/version/main.go cmd/vers.txt + ! test -d .git || make .version | grep 'version:' | cut -d ':' -f 2 | tr '\n' '_' | sed 's/_//g' > cmd/vers.txt go build $(GOFLAGS) -o $@ cmd/main.go +.version: + @git describe --tags --abbrev=0 | sed 's/^/version:/g' + @git tag --points-at HEAD | grep -q '' || echo "version:-1" + unittest: go test -v ./... diff --git a/cmd/vers.txt b/cmd/vers.txt @@ -1 +1 @@ -v23.03.02 -\ No newline at end of file +v23.03.01-1 +\ No newline at end of file diff --git a/internal/scripts/version/main.go b/internal/scripts/version/main.go @@ -1,10 +0,0 @@ -// Handles generating a version number -package main - -import ( - "github.com/enckse/pgl/version" -) - -func main() { - version.DefaultGitVersion() -}