mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Dependency updates
This commit is contained in:
22
vendor/github.com/gobuffalo/packr/v2/walk.go
generated
vendored
22
vendor/github.com/gobuffalo/packr/v2/walk.go
generated
vendored
@@ -11,6 +11,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// WalkFunc is used to walk a box
|
||||
type WalkFunc = packd.WalkFunc
|
||||
|
||||
// Walk will traverse the box and call the WalkFunc for each file in the box/folder.
|
||||
@@ -20,31 +21,34 @@ func (b *Box) Walk(wf WalkFunc) error {
|
||||
dr := b.DefaultResolver
|
||||
if dr == nil {
|
||||
cd := resolver.OsPath(b.ResolutionDir)
|
||||
dr = &resolver.Disk{Root: string(cd)}
|
||||
dr = &resolver.Disk{Root: cd}
|
||||
}
|
||||
if fm, ok := dr.(file.FileMappable); ok {
|
||||
for n, f := range fm.FileMap() {
|
||||
m[n] = f
|
||||
}
|
||||
}
|
||||
|
||||
b.moot.RLock()
|
||||
for n, r := range b.resolvers {
|
||||
f, err := r.Resolve("", n)
|
||||
var err error
|
||||
b.resolvers.Range(func(n string, r resolver.Resolver) bool {
|
||||
var f file.File
|
||||
f, err = r.Resolve("", n)
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
return false
|
||||
}
|
||||
keep := true
|
||||
for k := range m {
|
||||
if strings.ToLower(k) == strings.ToLower(n) {
|
||||
if strings.EqualFold(k, n) {
|
||||
keep = false
|
||||
}
|
||||
}
|
||||
if keep {
|
||||
m[n] = f
|
||||
}
|
||||
return true
|
||||
})
|
||||
if err != nil {
|
||||
return errors.WithStack(err)
|
||||
}
|
||||
b.moot.RUnlock()
|
||||
|
||||
var keys = make([]string, 0, len(m))
|
||||
for k := range m {
|
||||
@@ -63,7 +67,7 @@ func (b *Box) Walk(wf WalkFunc) error {
|
||||
}
|
||||
|
||||
// WalkPrefix will call box.Walk and call the WalkFunc when it finds paths that have a matching prefix
|
||||
func (b Box) WalkPrefix(prefix string, wf WalkFunc) error {
|
||||
func (b *Box) WalkPrefix(prefix string, wf WalkFunc) error {
|
||||
ipref := resolver.OsPath(prefix)
|
||||
return b.Walk(func(path string, f File) error {
|
||||
ipath := resolver.OsPath(path)
|
||||
|
||||
Reference in New Issue
Block a user