Add support for ignoring directories/files; fix compression of archives

This commit is contained in:
Dane Everitt
2020-04-18 23:26:23 -07:00
parent 8eaf590f78
commit df6d98bbda
10 changed files with 211 additions and 41 deletions

View File

@@ -38,6 +38,7 @@ func (fw *FileWalker) Walk(dir string, ctx context.Context, callback func (os.Fi
for _, f := range files {
if f.IsDir() {
fi := f
p := filepath.Join(cleaned, f.Name())
// Recursively call this function to continue digging through the directory tree within
// a seperate goroutine. If the context is canceled abort this process.
@@ -49,7 +50,7 @@ func (fw *FileWalker) Walk(dir string, ctx context.Context, callback func (os.Fi
// If the callback returns true, go ahead and keep walking deeper. This allows
// us to programatically continue deeper into directories, or stop digging
// if that pathway knows it needs nothing else.
if callback(f, p) {
if callback(fi, p) {
return fw.Walk(p, ctx, callback)
}