mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Merge branch '20190709-rename-binary-to-wtfutil'
This commit is contained in:
commit
f143efe4e2
10
Makefile
10
Makefile
@ -21,7 +21,7 @@ export GO111MODULE = on
|
|||||||
export GOPROXY = https://gocenter.io
|
export GOPROXY = https://gocenter.io
|
||||||
|
|
||||||
build:
|
build:
|
||||||
go build -o bin/wtf
|
go build -o bin/wtfutil
|
||||||
|
|
||||||
contrib_check:
|
contrib_check:
|
||||||
npx all-contributors-cli check
|
npx all-contributors-cli check
|
||||||
@ -29,17 +29,21 @@ contrib_check:
|
|||||||
install:
|
install:
|
||||||
@go clean
|
@go clean
|
||||||
@go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)"
|
@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:
|
lint:
|
||||||
structcheck ./...
|
structcheck ./...
|
||||||
varcheck ./...
|
varcheck ./...
|
||||||
|
|
||||||
run: build
|
run: build
|
||||||
bin/wtf
|
bin/wtfutil
|
||||||
|
|
||||||
size:
|
size:
|
||||||
loc --exclude _sample_configs/ _site/ docs/ Makefile *.md
|
loc --exclude _sample_configs/ _site/ docs/ Makefile *.md
|
||||||
|
|
||||||
test: build
|
test: build
|
||||||
go test ./...
|
go test ./...
|
||||||
|
|
||||||
|
uninstall:
|
||||||
|
@rm ~/go/bin/wtfutil
|
@ -51,14 +51,18 @@ func (widget *Widget) Refresh() {
|
|||||||
title := widget.CommonSettings().Title
|
title := widget.CommonSettings().Title
|
||||||
title = title + widget.sinceDateForTitle()
|
title = title + widget.sinceDateForTitle()
|
||||||
|
|
||||||
|
var wrap bool
|
||||||
var content string
|
var content string
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
wrap = true
|
||||||
content = err.Error()
|
content = err.Error()
|
||||||
} else {
|
} else {
|
||||||
|
wrap = false
|
||||||
content = widget.contentFrom(data)
|
content = widget.contentFrom(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
widget.Redraw(title, content, false)
|
widget.Redraw(title, content, wrap)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------- Unexported Functions -------------------- */
|
/* -------------------- Unexported Functions -------------------- */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user