Dont include pngs in package. Fix version output. Lint slice.

This commit is contained in:
David Newhall II 2019-06-10 14:54:21 -07:00
parent 3c79371f8d
commit 4ca74860f5
2 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,7 @@ package_build_osx: man macos
cp $(BINARY).macos $@/usr/local/bin/$(BINARY) cp $(BINARY).macos $@/usr/local/bin/$(BINARY)
cp *.1.gz $@/usr/local/share/man/man1 cp *.1.gz $@/usr/local/share/man/man1
cp examples/*.conf.example $@/usr/local/etc/$(BINARY)/ cp examples/*.conf.example $@/usr/local/etc/$(BINARY)/
cp examples/* $@/usr/local/share/doc/$(BINARY)/ cp examples/{*dash.json,up.conf.example} $@/usr/local/share/doc/$(BINARY)/
cp init/launchd/com.github.davidnewhall.$(BINARY).plist $@/Library/LaunchAgents/ cp init/launchd/com.github.davidnewhall.$(BINARY).plist $@/Library/LaunchAgents/
# Build an environment that can be packaged for linux. # Build an environment that can be packaged for linux.
@ -117,7 +117,7 @@ package_build_linux: man linux
cp *.1.gz $@/usr/share/man/man1 cp *.1.gz $@/usr/share/man/man1
cp examples/*.conf.example $@/etc/$(BINARY)/ cp examples/*.conf.example $@/etc/$(BINARY)/
cp examples/up.conf.example $@/etc/$(BINARY)/up.conf cp examples/up.conf.example $@/etc/$(BINARY)/up.conf
cp examples/* $@/usr/share/doc/$(BINARY)/ cp examples/{*dash.json,up.conf.example} $@/usr/share/doc/$(BINARY)/
cp init/systemd/$(BINARY).service $@/lib/systemd/system/ cp init/systemd/$(BINARY).service $@/lib/systemd/system/
check_fpm: check_fpm:

View File

@ -79,7 +79,7 @@ func parseFlags() string {
configFile := flag.StringP("config", "c", defaultConfFile, "Poller Config File (TOML Format)") configFile := flag.StringP("config", "c", defaultConfFile, "Poller Config File (TOML Format)")
version := flag.BoolP("version", "v", false, "Print the version and exit") version := flag.BoolP("version", "v", false, "Print the version and exit")
if flag.Parse(); *version { if flag.Parse(); *version {
fmt.Println("unifi-poller version:", Version) fmt.Printf("unifi-poller v%s\n", Version)
os.Exit(0) // don't run anything else. os.Exit(0) // don't run anything else.
} }
return *configFile return *configFile
@ -92,7 +92,7 @@ func (c *Config) CheckSites(controller *unifi.Unifi) error {
return err return err
} }
if !c.Quiet { if !c.Quiet {
msg := make([]string, 0) msg := []string{}
for _, site := range sites { for _, site := range sites {
msg = append(msg, site.Name+" ("+site.Desc+")") msg = append(msg, site.Name+" ("+site.Desc+")")
} }