From b4e3b7e3a2352d58e255d117d0743253e88cf3f1 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 9 Jul 2019 12:10:35 -0700 Subject: [PATCH 1/2] Changes the name of the installed binary from 'wtf' to 'wtfutil' This is to avoid conflict with the venerable 'wtf' acronym utility found here https://sourceforge.net/projects/bsdwtf/ --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ca33b73b..87084303 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ export GO111MODULE = on export GOPROXY = https://gocenter.io build: - go build -o bin/wtf + go build -o bin/wtfutil contrib_check: npx all-contributors-cli check @@ -29,17 +29,21 @@ contrib_check: install: @go clean @go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" - @which wtf || echo "Could not find wtf in PATH" && exit 0 + @mv ~/go/bin/wtf ~/go/bin/wtfutil + @which wtfutil || echo "Could not find wtfutil in PATH" && exit 0 lint: structcheck ./... varcheck ./... run: build - bin/wtf + bin/wtfutil size: loc --exclude _sample_configs/ _site/ docs/ Makefile *.md test: build go test ./... + +uninstall: + @rm ~/go/bin/wtfutil \ No newline at end of file From 2e7f242056a7a2f37f732b4ff6c74e60bb2fbc43 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 9 Jul 2019 13:00:41 -0700 Subject: [PATCH 2/2] HIBP module now wraps error text if an error occurrs --- modules/hibp/widget.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/hibp/widget.go b/modules/hibp/widget.go index 2756fc58..f6ff7488 100644 --- a/modules/hibp/widget.go +++ b/modules/hibp/widget.go @@ -51,14 +51,18 @@ func (widget *Widget) Refresh() { title := widget.CommonSettings().Title title = title + widget.sinceDateForTitle() + var wrap bool var content string + if err != nil { + wrap = true content = err.Error() } else { + wrap = false content = widget.contentFrom(data) } - widget.Redraw(title, content, false) + widget.Redraw(title, content, wrap) } /* -------------------- Unexported Functions -------------------- */