Dependency updates

This commit is contained in:
Stash Dev
2019-05-27 12:34:26 -07:00
parent 69917999ef
commit 4b037e1040
359 changed files with 60172 additions and 18749 deletions

View File

@@ -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)