未验证 提交 f0459924 编写于 作者: C chnliyong 提交者: GitHub

donot try to override version from tag (#461)

上级 b85b2814
......@@ -4,14 +4,9 @@ all: juicefs
REVISION := $(shell git rev-parse --short HEAD 2>/dev/null)
REVISIONDATE := $(shell git log -1 --pretty=format:'%ad' --date short 2>/dev/null)
VERSION := $(shell git describe --tags --match 'v*' 2>/dev/null | sed -e 's/^v//' -e 's/-g[0-9a-f]\{7,\}$$//')
PKG := github.com/juicedata/juicefs/pkg/version
LDFLAGS = -s -w
ifneq ($(strip $(VERSION)),)
LDFLAGS += -X $(PKG).revision=$(REVISION) \
-X $(PKG).revisionDate=$(REVISIONDATE) \
-X $(PKG).version=$(VERSION)
else ifneq ($(strip $(REVISION)),) # Use git clone with --depth or --no-tags
ifneq ($(strip $(REVISION)),) # Use git clone
LDFLAGS += -X $(PKG).revision=$(REVISION) \
-X $(PKG).revisionDate=$(REVISIONDATE)
endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册