diff --git a/core/poller/Makefile b/core/poller/Makefile index 8309b6d3..7c07f0ab 100644 --- a/core/poller/Makefile +++ b/core/poller/Makefile @@ -4,16 +4,17 @@ BINARY:=unifi-poller URL:=https://github.com/davidnewhall/$(BINARY) MAINT=David Newhall II -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) diff --git a/core/poller/cmd/unifi-poller/main.go b/core/poller/cmd/unifi-poller/main.go index 00cee875..1445b683 100644 --- a/core/poller/cmd/unifi-poller/main.go +++ b/core/poller/cmd/unifi-poller/main.go @@ -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()