From 80095fdf3cf8458455bc54869960db615d3a66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 16 Nov 2019 20:51:54 +0100 Subject: [PATCH] chainwatch: make target --- Makefile | 6 ++++++ cmd/lotus-chainwatch/main.go | 5 +++-- cmd/lotus-chainwatch/templates.go | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index b30f8712f..6faafaffe 100644 --- a/Makefile +++ b/Makefile @@ -109,6 +109,12 @@ fountain: go run github.com/GeertJohan/go.rice/rice append --exec fountain -i ./cmd/lotus-fountain .PHONY: fountain +chainwatch: + rm -f chainwatch + go build -o chainwatch ./cmd/lotus-chainwatch + go run github.com/GeertJohan/go.rice/rice append --exec chainwatch -i ./cmd/lotus-chainwatch +.PHONY: chainwatch + stats: rm -f stats go build -o stats ./tools/stats diff --git a/cmd/lotus-chainwatch/main.go b/cmd/lotus-chainwatch/main.go index 153ad8e83..49005a514 100644 --- a/cmd/lotus-chainwatch/main.go +++ b/cmd/lotus-chainwatch/main.go @@ -5,6 +5,7 @@ import ( "github.com/filecoin-project/lotus/build" lcli "github.com/filecoin-project/lotus/cli" logging "github.com/ipfs/go-log" + "golang.org/x/xerrors" "gopkg.in/urfave/cli.v2" "net/http" "os" @@ -37,7 +38,7 @@ func main() { } if err := app.Run(os.Args); err != nil { - log.Warn(err) + log.Warnf("%+v", err) return } } @@ -76,7 +77,7 @@ var runCmd = &cli.Command{ h, err := newHandler(api, st) if err != nil { - return err + return xerrors.Errorf("handler setup: %w", err) } http.Handle("/", h) diff --git a/cmd/lotus-chainwatch/templates.go b/cmd/lotus-chainwatch/templates.go index 2453e2b58..e119d7f0f 100644 --- a/cmd/lotus-chainwatch/templates.go +++ b/cmd/lotus-chainwatch/templates.go @@ -47,7 +47,7 @@ func newHandler(api api.FullNode, st *storage) (*handler, error) { base.Funcs(funcs) - return h, h.site.Walk(".", func(path string, info os.FileInfo, err error) error { + return h, h.site.Walk("", func(path string, info os.FileInfo, err error) error { if filepath.Ext(path) != ".html" { return nil }