From 6f372d85700cbee31aad3d80348d4ea80be22211 Mon Sep 17 00:00:00 2001 From: jmeaster30 Date: Sat, 20 Jan 2024 13:31:42 -0500 Subject: [PATCH] Fixed glob pattern --- libvore/path.go | 6 +----- main.go | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libvore/path.go b/libvore/path.go index 7d18dff..e887669 100644 --- a/libvore/path.go +++ b/libvore/path.go @@ -120,11 +120,7 @@ func (path *Path) GetFileList(currentDirectory string) []string { var results []string if strings.Trim(path.entries[0].value, "*") == "" { - for _, e := range entries { - if !e.IsDir() && pathMatches(e.Name(), path.entries[len(path.entries)-1].value) { - results = append(results, currentDirectory+"/"+e.Name()) - } - } + results = append(results, path.shrink().GetFileList(currentDirectory)...) } if path.entries[0].entryType == WildcardDirectory { diff --git a/main.go b/main.go index e7e5a9a..ddc53fd 100644 --- a/main.go +++ b/main.go @@ -109,6 +109,10 @@ func main() { } searchFiles := libvore.ParsePath(*files_arg).GetFileList(currentDir) + if len(searchFiles) == 0 { + fmt.Println("No files to search :(") + return + } results := vore.RunFiles(searchFiles, replaceModeArg, process_filenames)