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)
|
ifeq ($(OS), Windows_NT)
|
||||||
EXE=lume.exe
|
EXE=lume.exe
|
||||||
RM=del /f /q
|
RM=del /f /q
|
||||||
@ -8,8 +11,8 @@ endif
|
|||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
go build -o ${EXE} ./cmd/lume
|
go build -o ${EXE} -ldflags="${LDFLAGS}" ./cmd/lume
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
${RM} ${EXE}
|
${RM} ${EXE}
|
@ -29,7 +29,7 @@ func init() {
|
|||||||
RegisterCommand(NewCmdVersion())
|
RegisterCommand(NewCmdVersion())
|
||||||
}
|
}
|
||||||
|
|
||||||
const Version = "0.1.0-pre"
|
var Version string = "0.1.0-pre"
|
||||||
|
|
||||||
const lumercFile string = ".lumerc"
|
const lumercFile string = ".lumerc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user