From ea1d8d52c69a82066753fc93b74790b1b6926421 Mon Sep 17 00:00:00 2001 From: Seednode Date: Wed, 2 Nov 2022 09:10:55 -0500 Subject: [PATCH] Maybe fixed incorrect total scanned file count displayed when -v is passed --- cmd/files.go | 7 +++++-- cmd/version.go | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cmd/files.go b/cmd/files.go index 36430ac..8df9419 100644 --- a/cmd/files.go +++ b/cmd/files.go @@ -142,9 +142,8 @@ func appendPath(directory, path string, files *Files, stats *Stats) error { files.Mutex.Lock() files.List[directory] = append(files.List[directory], path) - files.Mutex.Unlock() - stats.IncrementFilesMatched() + files.Mutex.Unlock() return nil } @@ -489,8 +488,12 @@ func pickFile(args []string, filters *Filters, sort string, fileCache *[]string) ) } + fmt.Printf("Directory count is %v\n", len(files.List)) + fileList = prepareDirectories(&files, sort) + fmt.Printf("File count is %v\n", len(fileList)) + if Cache { *fileCache = append(*fileCache, fileList...) } diff --git a/cmd/version.go b/cmd/version.go index a7602a4..4009d45 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -10,7 +10,7 @@ import ( "github.com/spf13/cobra" ) -var Version = "0.20.10" +var Version = "0.21.0" func init() { rootCmd.AddCommand(versionCmd)