1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-04 14:48:29 +00:00

-d: exclude non-directories

Adding flag, and supporting functionality for exluding entries that are
non-directories

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-11-17 22:43:02 -05:00
parent 353436a031
commit c0a5cb25ec
Signed by: vbatts
GPG key ID: 10937E57733F1362
7 changed files with 117 additions and 15 deletions

View file

@ -15,6 +15,11 @@ import (
// returns true, then the path is not included in the spec.
type ExcludeFunc func(path string, info os.FileInfo) bool
// ExcludeNonDirectories is an ExcludeFunc for excluding all paths that are not directories
var ExcludeNonDirectories = func(path string, info os.FileInfo) bool {
return !info.IsDir()
}
var defaultSetKeywords = []KeyVal{"type=file", "nlink=1", "flags=none", "mode=0664"}
// Walk from root directory and assemble the DirectoryHierarchy. excludes