fix version
This commit is contained in:
parent
1aeefe0ad9
commit
0ada6d0972
16
Makefile
16
Makefile
|
@ -1,15 +1,23 @@
|
||||||
|
VERSION ?= $(shell git describe --tags 2>/dev/null)
|
||||||
|
ifeq "$(VERSION)" ""
|
||||||
|
VERSION := UNKNOWN
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: \
|
.PHONY: \
|
||||||
all
|
all \
|
||||||
|
test
|
||||||
|
|
||||||
all: bin/pomo
|
all: bin/pomo
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -v bin/pomo bindata.go
|
rm -v bin/* 2> /dev/null || true
|
||||||
|
|
||||||
bindata.go:
|
bindata.go:
|
||||||
go-bindata -pkg main -o $@ tomato-icon.png
|
go-bindata -pkg main -o $@ tomato-icon.png
|
||||||
|
|
||||||
|
test:
|
||||||
|
go test ./...
|
||||||
|
|
||||||
bin/pomo: bindata.go
|
bin/pomo: bindata.go
|
||||||
mkdir bin 2>/dev/null
|
@echo mkdir bin 2>/dev/null || true
|
||||||
go build -o bin/pomo
|
go build -ldflags "-X main.Version=$(VERSION)" -o bin/pomo
|
||||||
|
|
2
main.go
2
main.go
|
@ -97,7 +97,7 @@ func main() {
|
||||||
var (
|
var (
|
||||||
path = app.StringOpt("p path", defaultConfigPath(), "path to the pomo config directory")
|
path = app.StringOpt("p path", defaultConfigPath(), "path to the pomo config directory")
|
||||||
)
|
)
|
||||||
app.Version("v version", version)
|
app.Version("v version", Version)
|
||||||
app.Command("start s", "start a new task", start(path))
|
app.Command("start s", "start a new task", start(path))
|
||||||
app.Command("init", "initialize the sqlite database", initialize(path))
|
app.Command("init", "initialize the sqlite database", initialize(path))
|
||||||
app.Command("list l", "list historical tasks", list(path))
|
app.Command("list l", "list historical tasks", list(path))
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
var version = "undefined"
|
var Version = "undefined"
|
||||||
|
|
Loading…
Reference in New Issue