Skip to content

Commit

Permalink
Update main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
aymaneallaoui authored Sep 10, 2024
1 parent 7d8ce49 commit c49ce23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ func scanDirectory(root string, prefix string, ignoredDirs map[string]struct{},
return "", fmt.Errorf("error reading directory %s: %v", root, err)
}

// Filter out excluded entries

filteredEntries := []os.DirEntry{}
for _, entry := range entries {
if _, ok := ignoredDirs[entry.Name()]; ok {
logrus.Infof("Skipping ignored directory: %s", entry.Name())
continue
}

// Check if the file or directory should be excluded

excluded := false
for _, pattern := range excludePatterns {
regexPattern, err := patternToRegex(pattern)
Expand All @@ -74,7 +74,7 @@ func scanDirectory(root string, prefix string, ignoredDirs map[string]struct{},
}
}

// Limit directory depth

if maxDepth != -1 && currentDepth >= maxDepth {
return "", nil
}
Expand Down

0 comments on commit c49ce23

Please sign in to comment.