Compare commits
2 Commits
a933343e1b
...
5b17adb071
Author | SHA1 | Date | |
---|---|---|---|
5b17adb071 | |||
38ab315a9b |
13
Makefile
13
Makefile
@ -1,17 +1,24 @@
|
|||||||
LUME_VERSION ?= $(shell git describe --tags --always)
|
V ?= 0
|
||||||
LDFLAGS := ${LDFLAGS} -X git.kill0.net/chill9/lume/cmd.Version=${LUME_VERSION}
|
Q = $(if $(filter 1, $V),, @)
|
||||||
|
|
||||||
ifeq ($(OS), Windows_NT)
|
ifeq ($(OS), Windows_NT)
|
||||||
EXE=lume.exe
|
EXE=lume.exe
|
||||||
RM=del /f /q
|
RM=del /f /q
|
||||||
|
BUILD_DATE=$(shell powershell Get-Date -Format "yyyy-MM-ddThh:mm:sszzz")
|
||||||
else
|
else
|
||||||
EXE=lume
|
EXE=lume
|
||||||
EXE=rm -f
|
EXE=rm -f
|
||||||
|
BUILD_DATE=$(shell date --iso-8601=seconds)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
LUME_VERSION ?= $(shell git describe --tags --always)
|
||||||
|
LDFLAGS := ${LDFLAGS} \
|
||||||
|
-X git.kill0.net/chill9/lume/cmd.Version=${LUME_VERSION} \
|
||||||
|
-X git.kill0.net/chill9/lume/cmd.BuildDate=${BUILD_DATE}
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
go build -o ${EXE} -ldflags="${LDFLAGS}" ./cmd/lume
|
$(Q) go build -o ${EXE} -ldflags="${LDFLAGS}" ./cmd/lume
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
@ -30,6 +30,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var Version string = "0.1.0-pre"
|
var Version string = "0.1.0-pre"
|
||||||
|
var BuildDate string
|
||||||
|
|
||||||
const lumercFile string = ".lumerc"
|
const lumercFile string = ".lumerc"
|
||||||
|
|
||||||
|
@ -19,5 +19,8 @@ func VersionCmd(args CmdArgs) (int, error) {
|
|||||||
fmt.Printf("lume %s\n", Version)
|
fmt.Printf("lume %s\n", Version)
|
||||||
fmt.Printf(" os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
fmt.Printf(" os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||||
fmt.Printf(" go version: %s\n", runtime.Version())
|
fmt.Printf(" go version: %s\n", runtime.Version())
|
||||||
|
if BuildDate != "" {
|
||||||
|
fmt.Printf(" build date: %s\n", BuildDate)
|
||||||
|
}
|
||||||
return ExitSuccess, nil
|
return ExitSuccess, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user