mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
modules: Add config option modules.vendorClosest
Fixes #8235 Fixes #8242
This commit is contained in:
@@ -33,6 +33,14 @@ var (
|
||||
globMu sync.RWMutex
|
||||
)
|
||||
|
||||
type caseInsensitiveGlob struct {
|
||||
g glob.Glob
|
||||
}
|
||||
|
||||
func (g caseInsensitiveGlob) Match(s string) bool {
|
||||
return g.g.Match(strings.ToLower(s))
|
||||
|
||||
}
|
||||
func GetGlob(pattern string) (glob.Glob, error) {
|
||||
var eg globErr
|
||||
|
||||
@@ -46,7 +54,7 @@ func GetGlob(pattern string) (glob.Glob, error) {
|
||||
|
||||
var err error
|
||||
g, err := glob.Compile(strings.ToLower(pattern), '/')
|
||||
eg = globErr{g, err}
|
||||
eg = globErr{caseInsensitiveGlob{g: g}, err}
|
||||
|
||||
globMu.Lock()
|
||||
globCache[pattern] = eg
|
||||
|
Reference in New Issue
Block a user