diff --git a/Readme.md b/Readme.md index 74558b7..9e97017 100644 --- a/Readme.md +++ b/Readme.md @@ -14,9 +14,10 @@ $ node-prune • complete duration=217ms files_removed=1,222 files_total=25,520 size_removed=6.8 MB ``` + ## What? -node-prune is a small tool to prune unecessary files from ./node_modules. +node-prune is a small tool to prune unnecessary files from ./node_modules. ## Why? diff --git a/prune.go b/prune.go index e77507e..13912d4 100644 --- a/prune.go +++ b/prune.go @@ -131,7 +131,10 @@ func (p Pruner) Prune() (*Stats, error) { stats.FilesTotal++ + ctx := p.log.WithField("path", path) + if !p.prune(path, info) { + ctx.Debug("keeping") return nil } @@ -139,7 +142,7 @@ func (p Pruner) Prune() (*Stats, error) { return filepath.SkipDir } - p.log.WithField("path", path).Debug("prune") + ctx.Debug("prune") stats.FilesRemoved++ stats.SizeRemoved += info.Size()