Makefile cleanup.

This commit is contained in:
David Newhall II 2019-06-13 01:04:53 -07:00
parent 86b74318cd
commit eb5ddf0a6a
2 changed files with 8 additions and 7 deletions

View File

@ -4,16 +4,17 @@
BINARY:=unifi-poller
URL:=https://github.com/davidnewhall/$(BINARY)
MAINT=David Newhall II <david at sleepers dot pro>
DESC=This daemon polls a Unifi controller at a short interval and stores the collected metric data in an Influx Database.
DESC=This daemon polls a Unifi controller at a short interval and stores the collected measurements in an Influx Database.
OSX_PKG_PREFIX=com.github.davidnewhall
GOLANGCI_LINT_ARGS=--enable-all -D gochecknoglobals
PACKAGE:=./cmd/$(BINARY)
LIBRARY:=./pkg/$(BINARY)
ITERATION:=$(shell git rev-list --count HEAD||echo 0)
ifeq ($(VERSION),)
VERSION:=$(shell git tag -l --merged | tail -n1 | tr -d v||echo development)
endif
ITERATION:=$(shell git rev-list --count HEAD||echo 0)
OSX_PKG_PREFIX=com.github.davidnewhall
GOLANGCI_LINT_ARGS=--enable-all -D gochecknoglobals
# rpm is wierd and changes - to _ in versions.
RPMVERSION:=$(shell echo $(VERSION) | tr -- - _)
all: man build
@ -167,7 +168,7 @@ $(BINARY).rb: v$(VERSION).tar.gz.sha256
# Run code tests and lint.
test: lint
# Testing.
go test -race -covermode=atomic $(LIBRARY)
go test -race -covermode=atomic $(PACKAGE) $(LIBRARY)
lint:
# Checking lint.
golangci-lint run $(GOLANGCI_LINT_ARGS)

View File

@ -12,7 +12,7 @@ func main() {
u := &unifipoller.UnifiPoller{}
if u.ParseFlags(os.Args[1:]); u.ShowVer {
fmt.Printf("unifi-poller v%s\n", unifipoller.Version)
return // don't run anything else.
return // don't run anything else w/ version request.
}
if err := u.GetConfig(); err != nil {
u.Flag.Usage()