fix for versions with 'v' prefix

This commit is contained in:
Cory Bennett
2016-06-28 23:07:06 -07:00
parent fa4ac4b7ec
commit 0e4e85aafd
+4 -4
View File
@@ -33,8 +33,8 @@ DIST=$(CWD)$(SEP)dist
GOBIN ?= $(CWD) GOBIN ?= $(CWD)
CURVER ?= $(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}') CURVER ?= $(patsubst v%,%,$(shell [ -d .git ] && git describe --abbrev=0 --tags || grep ^\#\# CHANGELOG.md | awk '{print $$2; exit}'))
LDFLAGS:=-X jira.VERSION=$(patsubst v%,%,$(CURVER)) -w LDFLAGS:=-X jira.VERSION=$(CURVER) -w
# use make DEBUG=1 and you can get a debuggable golang binary # use make DEBUG=1 and you can get a debuggable golang binary
# see https://github.com/mailgun/godebug # see https://github.com/mailgun/godebug
@@ -76,7 +76,7 @@ NEWVER ?= $(shell echo $(CURVER) | awk -F. '{print $$1"."$$2"."$$3+1}')
TODAY := $(shell date +%Y-%m-%d) TODAY := $(shell date +%Y-%m-%d)
changes: changes:
@git log --pretty=format:"* %s [%cn] [%h]" --no-merges ^$(CURVER) HEAD main/*.go *.go | grep -vE 'gofmt|go fmt' @git log --pretty=format:"* %s [%cn] [%h]" --no-merges ^v$(CURVER) HEAD main/*.go *.go | grep -vE 'gofmt|go fmt'
update-changelog: update-changelog:
@echo "# Changelog" > CHANGELOG.md.new; \ @echo "# Changelog" > CHANGELOG.md.new; \
@@ -92,7 +92,7 @@ update-changelog:
git tag v$(NEWVER) git tag v$(NEWVER)
version: version:
@echo $(patsubst v%,%,$(CURVER)) @echo $(CURVER)
clean: clean:
rm -rf pkg dist bin src ./$(NAME) rm -rf pkg dist bin src ./$(NAME)