validation fixed

This commit is contained in:
asoseil 2017-12-16 17:34:48 +01:00
parent 4c8b8d9931
commit 142a561a93
1 changed files with 8 additions and 9 deletions

View File

@ -355,15 +355,14 @@ func (p *Project) Validate(path string, fiche bool) bool {
if !array(e, p.Watcher.Exts) {
return false
}
} else {
separator := string(os.PathSeparator)
// supported paths
for _, v := range p.Watcher.Ignore {
s := append([]string{p.Path}, strings.Split(v, separator)...)
abs, _ := filepath.Abs(filepath.Join(s...))
if path == abs || strings.HasPrefix(path, abs+separator) {
return false
}
}
separator := string(os.PathSeparator)
// supported paths
for _, v := range p.Watcher.Ignore {
s := append([]string{p.Path}, strings.Split(v, separator)...)
abs, _ := filepath.Abs(filepath.Join(s...))
if path == abs || strings.HasPrefix(path, abs+separator) {
return false
}
}
// file check