mirror of
https://github.com/LukeHagar/slinky.git
synced 2025-12-06 04:21:20 +00:00
Enhance ignore logic in CollectURLsWithIgnoreConfig to include debug output for ignored paths. This change improves visibility into the URL collection process by logging paths that are ignored based on specified patterns, while also cleaning up redundant checks for ignored paths.
This commit is contained in:
@@ -203,6 +203,14 @@ func CollectURLsWithIgnoreConfig(rootPath string, globs []string, respectGitigno
|
||||
if err != nil {
|
||||
return nil
|
||||
}
|
||||
|
||||
if (ign != nil && ign.MatchesPath(path)) || (slPathIgnore != nil && slPathIgnore.MatchesPath(path)) {
|
||||
if isDebugEnv() {
|
||||
fmt.Printf("::debug:: Ignoring path: %s\n", path)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
rel, rerr := filepath.Rel(cleanRoot, path)
|
||||
if rerr != nil {
|
||||
rel = path
|
||||
@@ -220,13 +228,6 @@ func CollectURLsWithIgnoreConfig(rootPath string, globs []string, respectGitigno
|
||||
if filepath.Base(path) == ".slinkignore" || rel == ".slinkignore" || strings.HasSuffix(rel, "/.slinkignore") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if (ign != nil && ign.MatchesPath(rel)) || (slPathIgnore != nil && slPathIgnore.MatchesPath(rel)) {
|
||||
if isDebugEnv() {
|
||||
fmt.Printf("::debug:: Ignoring file: %s\n", rel)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
info, ierr := d.Info()
|
||||
if ierr != nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user