mirror of
https://github.com/tnypxl/rollup.git
synced 2025-12-15 15:03:17 +00:00
fix: improve file ignore pattern matching for nested directories
This commit is contained in:
@@ -87,12 +87,16 @@ func isIgnored(filePath string, patterns []string) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
matched, err := filepath.Match(pattern, filepath.Base(filePath))
|
// Check if the pattern matches any part of the file path
|
||||||
|
pathParts := strings.Split(filePath, string(os.PathSeparator))
|
||||||
|
for _, part := range pathParts {
|
||||||
|
matched, err := filepath.Match(pattern, part)
|
||||||
if err == nil && matched {
|
if err == nil && matched {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user