mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +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
@@ -49,12 +49,17 @@ func TestGlob(t *testing.T) {
|
||||
create("jsonfiles/sub/d3.json")
|
||||
create("jsonfiles/d1.xml")
|
||||
create("a/b/c/e/f.json")
|
||||
create("UPPER/sub/style.css")
|
||||
create("root/UPPER/sub/style.css")
|
||||
|
||||
c.Assert(collect("**.json"), qt.HasLen, 5)
|
||||
c.Assert(collect("**"), qt.HasLen, 6)
|
||||
c.Assert(collect("**"), qt.HasLen, 8)
|
||||
c.Assert(collect(""), qt.HasLen, 0)
|
||||
c.Assert(collect("jsonfiles/*.json"), qt.HasLen, 2)
|
||||
c.Assert(collect("*.json"), qt.HasLen, 1)
|
||||
c.Assert(collect("**.xml"), qt.HasLen, 1)
|
||||
c.Assert(collect(filepath.FromSlash("/jsonfiles/*.json")), qt.HasLen, 2)
|
||||
c.Assert(collect("UPPER/sub/style.css"), qt.HasLen, 1)
|
||||
c.Assert(collect("root/UPPER/sub/style.css"), qt.HasLen, 1)
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user