mirror of
https://github.com/wahyd4/node-prune.git
synced 2026-08-11 14:17:06 +10:00
add log for keeping a file
This commit is contained in:
@@ -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?
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user