From e2493252c91230ae15de45fdf4414fd44f22b094 Mon Sep 17 00:00:00 2001 From: David Newhall II Date: Thu, 13 Jun 2019 01:04:53 -0700 Subject: [PATCH] Makefile cleanup. --- integrations/inputunifi/Makefile | 13 +++++++------ integrations/inputunifi/cmd/unifi-poller/main.go | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/integrations/inputunifi/Makefile b/integrations/inputunifi/Makefile index 8309b6d3..7c07f0ab 100644 --- a/integrations/inputunifi/Makefile +++ b/integrations/inputunifi/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/integrations/inputunifi/cmd/unifi-poller/main.go b/integrations/inputunifi/cmd/unifi-poller/main.go index 00cee875..1445b683 100644 --- a/integrations/inputunifi/cmd/unifi-poller/main.go +++ b/integrations/inputunifi/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()