Skip to content

Commit

Permalink
Fix - Won't list files in sub dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
xplshn committed Mar 5, 2024
1 parent 71bf7f8 commit 1ef541f
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions helperFunctions.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,18 +250,15 @@ func isExecutable(filePath string) bool {
// listFilesInDir lists all files in a directory
func listFilesInDir(dir string) ([]string, error) {
var files []string
err := filepath.Walk(dir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
if !info.IsDir() {
files = append(files, path)
}
return nil
})
entries, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
for _, entry := range entries {
if !entry.IsDir() {
files = append(files, dir+"/"+entry.Name())
}
}
return files, nil
}

Expand Down

0 comments on commit 1ef541f

Please sign in to comment.