diff --git a/builder/fs/fs.go b/builder/fs/fs.go index 70d43ead..300b3d10 100644 --- a/builder/fs/fs.go +++ b/builder/fs/fs.go @@ -10,6 +10,8 @@ var ErrNotExist = fs.ErrNotExist var WalkDir = fs.WalkDir +var SkipDir = fs.SkipDir + type DirEntry = fs.DirEntry type File = fs.File diff --git a/builder/source.go b/builder/source.go index 63fdb925..3d9b1ad4 100644 --- a/builder/source.go +++ b/builder/source.go @@ -2,7 +2,6 @@ package main import ( "io" - "path" "time" "github.com/macrat/blanktar/builder/fs" @@ -72,7 +71,10 @@ func WalkSources(f fs.Readable, fn WalkSourcesFunc) error { if err != nil { return err } - if !d.IsDir() && path.Base(name)[0] != '.' { + if d.IsDir() && d.Name()[0] == '.' { + return fs.SkipDir + } + if !d.IsDir() && d.Name()[0] != '.' { fn(Source{name, f}) } return nil