From 892de5fff57db20137bd6778dedd85193aa805ef Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sat, 18 Nov 2017 17:34:54 -0800 Subject: [PATCH] fix default dir --- cmd/node-prune/main.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/node-prune/main.go b/cmd/node-prune/main.go index f8a581b..77c1e72 100644 --- a/cmd/node-prune/main.go +++ b/cmd/node-prune/main.go @@ -26,7 +26,13 @@ func main() { log.SetLevel(log.DebugLevel) } - p := prune.New(prune.WithDir(dir)) + var options []prune.Option + + if dir != "" { + options = append(options, prune.WithDir(dir)) + } + + p := prune.New(options...) stats, err := p.Prune() if err != nil {