commit 8ce41c88b5749b9c6ea52059af28dcb95ed60387 parent a34be9975bbb7b2f0396626748f3ac10901fd68a Author: Sean Enck <sean@ttypty.com> Date: Sat, 4 Mar 2023 16:08:04 -0500 use upstream version file Diffstat:
| M | Makefile | | | 2 | +- |
| D | scripts/version/configure | | | 22 | ---------------------- |
| A | scripts/version/main.go | | | 10 | ++++++++++ |
3 files changed, 11 insertions(+), 23 deletions(-)
diff --git a/Makefile b/Makefile @@ -7,7 +7,7 @@ all: $(TARGET) build: $(TARGET) $(TARGET): cmd/main.go internal/**/*.go go.* internal/cli/completions* - ./scripts/version/configure cmd/vers.txt + go run scripts/version/main.go cmd/vers.txt go build $(GOFLAGS) -o $@ cmd/main.go unittest: diff --git a/scripts/version/configure b/scripts/version/configure @@ -1,22 +0,0 @@ -#!/usr/bin/env sh -if [ ! -d .git ]; then - 2>&1 echo "not git controlled" - exit 0 -fi - -_version() { - curr=v$(date +%g.%m.) - tag=$(git describe --tags --abbrev=0) - minor=00 - if echo "$tag" | grep -q "$curr*"; then - minor=$(echo "$tag" | cut -d '.' -f 3 | sed 's/^0//g') - minor=$((minor+1)) - if [ $minor -lt 10 ]; then - minor="0$minor" - fi - fi - vers="$curr$minor" - printf "%s" "$vers" -} - -_version > "$1" diff --git a/scripts/version/main.go b/scripts/version/main.go @@ -0,0 +1,10 @@ +// Handles generating a version number +package main + +import ( + "github.com/enckse/pgl/version" +) + +func main() { + version.DefaultGitVersion() +}