Use LDFLAGS to set build version
This commit is contained in:
parent
c8d0d306e4
commit
4d3074fa14
7
Makefile
7
Makefile
@ -1,3 +1,6 @@
|
||||
LUME_VERSION ?= $(shell git describe --tags --always)
|
||||
LDFLAGS := ${LDFLAGS} -X git.kill0.net/chill9/lume/cmd.Version=${LUME_VERSION}
|
||||
|
||||
ifeq ($(OS), Windows_NT)
|
||||
EXE=lume.exe
|
||||
RM=del /f /q
|
||||
@ -8,8 +11,8 @@ endif
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
go build -o ${EXE} ./cmd/lume
|
||||
go build -o ${EXE} -ldflags="${LDFLAGS}" ./cmd/lume
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
${RM} ${EXE}
|
||||
${RM} ${EXE}
|
@ -29,7 +29,7 @@ func init() {
|
||||
RegisterCommand(NewCmdVersion())
|
||||
}
|
||||
|
||||
const Version = "0.1.0-pre"
|
||||
var Version string = "0.1.0-pre"
|
||||
|
||||
const lumercFile string = ".lumerc"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user