Skip to content

Commit

Permalink
Only set version ldflags on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnelson committed Jun 30, 2020
1 parent 9938e08 commit 3b54838
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ MAKEFLAGS += --no-print-directory
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
HOSTGO := env -u GOOS -u GOARCH -u GOARM -- go
LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch) -X main.version=$(version)

LDFLAGS := $(LDFLAGS) -X main.commit=$(commit) -X main.branch=$(branch)
ifneq ($(tag),)
LDFLAGS += -X main.version=$(version)
endif

GOFILES ?= $(shell git ls-files '*.go')
GOFMT ?= $(shell gofmt -l -s $(filter-out plugins/parsers/influx/machine.go, $(GOFILES)))

Expand Down

0 comments on commit 3b54838

Please sign in to comment.