summaryrefslogtreecommitdiffstats
path: root/hugofs/glob.go
diff options
context:
space:
mode:
authorsatotake <doublequotation@gmail.com>2022-09-21 15:01:54 +0000
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-09-23 13:12:57 +0200
commit281554ee97eb243af097611aaf6bfec8940ad6d1 (patch)
treee7581707bac6026c78ecc77a23e378e2fc30e68e /hugofs/glob.go
parentf3560aa0e170f8bbc1e5ab41f1e54bd819da5cc3 (diff)
hugofs: Fix glob case-sensitivity bug
On Linux, `hugofs.Glob` does not hit any directories which includes uppercase letters. (This does not happen on macOS.) Since `resources.GetMatch/Match` uses `Glob`, ``` {{ resources.GetMatch "Foo/bar.css" }} ``` this does not match `assets/Foo/bar.css` . On the other hand, you can get it with ``` {{ resources.Get "Foo/bar.css" }} ```
Diffstat (limited to 'hugofs/glob.go')
-rw-r--r--hugofs/glob.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/hugofs/glob.go b/hugofs/glob.go
index 147b6b9f1..e691cdc10 100644
--- a/hugofs/glob.go
+++ b/hugofs/glob.go
@@ -26,14 +26,14 @@ import (
// Glob walks the fs and passes all matches to the handle func.
// The handle func can return true to signal a stop.
func Glob(fs afero.Fs, pattern string, handle func(fi FileMetaInfo) (bool, error)) error {
- pattern = glob.NormalizePath(pattern)
+ pattern = glob.NormalizePathCaseSensitive(pattern)
if pattern == "" {
return nil
}
- g, err := glob.GetGlob(pattern)
+ g, err := glob.GetFilenamesGlob(pattern)
if err != nil {
- return nil
+ return err
}
hasSuperAsterisk := strings.Contains(pattern, "**")