mirror of
https://github.com/LukeHagar/slinky.git
synced 2025-12-06 04:21:20 +00:00
Add logic to skip .slinkignore files during URL collection in fsurls.go
Enhance the CollectURLs and CollectURLsProgress functions to ensure that any .slinkignore files are excluded from scanning. This change improves the handling of ignored paths and maintains consistency in the ignore logic.
This commit is contained in:
@@ -108,6 +108,12 @@ func CollectURLs(rootPath string, globs []string, respectGitignore bool) (map[st
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Always skip any .slinkignore file from scanning
|
||||
if filepath.Base(path) == ".slinkignore" || rel == ".slinkignore" || strings.HasSuffix(rel, "/.slinkignore") {
|
||||
return nil
|
||||
}
|
||||
|
||||
if (ign != nil && ign.MatchesPath(rel)) || (slPathIgnore != nil && slPathIgnore.MatchesPath(rel)) {
|
||||
return nil
|
||||
}
|
||||
@@ -249,6 +255,10 @@ func CollectURLsProgress(rootPath string, globs []string, respectGitignore bool,
|
||||
}
|
||||
return nil
|
||||
}
|
||||
// Always skip any .slinkignore file from scanning
|
||||
if filepath.Base(path) == ".slinkignore" || rel == ".slinkignore" || strings.HasSuffix(rel, "/.slinkignore") {
|
||||
return nil
|
||||
}
|
||||
if (ign != nil && ign.MatchesPath(rel)) || (slPathIgnore != nil && slPathIgnore.MatchesPath(rel)) {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user