From 5ae070e74e9508215bd35c1284ab3d5b1f020ef7 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Sat, 18 Nov 2017 17:25:42 -0800 Subject: [PATCH] add returning of SkipDir if a dir should be pruned --- prune.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/prune.go b/prune.go index 66a31b8..5bb423f 100644 --- a/prune.go +++ b/prune.go @@ -42,6 +42,10 @@ func (p Pruner) Prune() (*Stats, error) { return nil } + if info.IsDir() { + return filepath.SkipDir + } + p.Log.WithField("path", path).Debug("prune") stats.FilesRemoved++ stats.SizeRemoved += info.Size()