diff --git a/realize/projects.go b/realize/projects.go index 144a83e..8d25a42 100644 --- a/realize/projects.go +++ b/realize/projects.go @@ -348,6 +348,10 @@ func (p *Project) Validate(path string, fcheck bool) bool { } // check for a valid ext or path if e := ext(path); e != "" { + if len(p.Watcher.Exts) == 0{ + return false + } + // check ignored for _, v := range p.Watcher.IgnoredExts { if v == e { return false @@ -355,6 +359,7 @@ func (p *Project) Validate(path string, fcheck bool) bool { } // supported extensions for index, v := range p.Watcher.Exts{ + println(v) if e == v { break } diff --git a/realize/projects_test.go b/realize/projects_test.go index 763fd06..ca50386 100644 --- a/realize/projects_test.go +++ b/realize/projects_test.go @@ -128,13 +128,14 @@ func TestProject_Validate(t *testing.T) { r.Projects = append(r.Projects, Project{ parent: &r, Watcher: Watch{ - Exts: []string{"go","html"}, + Exts: []string{}, IgnoredPaths: []string{"/test/ignore"}, }, }) for i, v := range data { - if r.Projects[0].Validate(i, false) != v { - t.Error("Unexpected error", i, "expected", v) + result := r.Projects[0].Validate(i, false) + if result != v { + t.Error("Unexpected error", i, "expected", v, result) } } }