diff options
author | satotake <[email protected]> | 2022-09-21 15:01:54 +0000 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2022-09-23 13:12:57 +0200 |
commit | 281554ee97eb243af097611aaf6bfec8940ad6d1 (patch) | |
tree | e7581707bac6026c78ecc77a23e378e2fc30e68e /hugofs/glob.go | |
parent | f3560aa0e170f8bbc1e5ab41f1e54bd819da5cc3 (diff) | |
download | hugo-281554ee97eb243af097611aaf6bfec8940ad6d1.tar.gz hugo-281554ee97eb243af097611aaf6bfec8940ad6d1.zip |
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.go | 6 |
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, "**") |