mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
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" }} ```
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
f3560aa0e1
commit
281554ee97
@@ -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, "**")
|
||||
|
Reference in New Issue
Block a user