Skip to content

Commit

Permalink
Fixed glob pattern
Browse files Browse the repository at this point in the history
  • Loading branch information
jmeaster30 committed Jan 20, 2024
1 parent 99e2600 commit 6f372d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 1 addition & 5 deletions libvore/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 6f372d8

Please sign in to comment.