Skip to content

Commit 664ef74

Browse files
committed
Allow setting custom version but use git by default
Makefile: Allow using `VERSION` to provide a version override when building the project. This allows for building using a tarball, without requiring git.
1 parent 47fc009 commit 664ef74

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Diff for: Makefile

+1-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ endif
3333
PROJECT := github.com/kubernetes-sigs/cri-tools
3434
BINDIR ?= /usr/local/bin
3535

36-
VERSION := $(shell git describe --tags --dirty --always)
37-
VERSION := $(VERSION:v%=%)
36+
VERSION ?= $(shell git describe --tags --dirty --always | sed 's/^v//')
3837
GO_LDFLAGS := -X $(PROJECT)/pkg/version.Version=$(VERSION)
3938

4039
BUILD_PATH := $(shell pwd)/build

0 commit comments

Comments
 (0)