diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-02-14 19:24:13 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-02-16 16:30:01 +0100 |
commit | bdfbcf6f4b4ab53a617ab76f72e8aa28da6067de (patch) | |
tree | a5b2fb8aeabe9103bb44b2516533f2c498806d08 /hugofs | |
parent | b60e9279ab95030828eb4f822be96250284c4d8d (diff) | |
download | hugo-bdfbcf6f4b4ab53a617ab76f72e8aa28da6067de.tar.gz hugo-bdfbcf6f4b4ab53a617ab76f72e8aa28da6067de.zip |
modules: Add config option modules.vendorClosest
Fixes #8235
Fixes #8242
Diffstat (limited to 'hugofs')
-rw-r--r-- | hugofs/glob/glob.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/hugofs/glob/glob.go b/hugofs/glob/glob.go index 5d2d3d5e5..57115ddfa 100644 --- a/hugofs/glob/glob.go +++ b/hugofs/glob/glob.go @@ -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 |