validation fixed
This commit is contained in:
parent
4c8b8d9931
commit
142a561a93
|
@ -355,15 +355,14 @@ func (p *Project) Validate(path string, fiche bool) bool {
|
||||||
if !array(e, p.Watcher.Exts) {
|
if !array(e, p.Watcher.Exts) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
separator := string(os.PathSeparator)
|
separator := string(os.PathSeparator)
|
||||||
// supported paths
|
// supported paths
|
||||||
for _, v := range p.Watcher.Ignore {
|
for _, v := range p.Watcher.Ignore {
|
||||||
s := append([]string{p.Path}, strings.Split(v, separator)...)
|
s := append([]string{p.Path}, strings.Split(v, separator)...)
|
||||||
abs, _ := filepath.Abs(filepath.Join(s...))
|
abs, _ := filepath.Abs(filepath.Join(s...))
|
||||||
if path == abs || strings.HasPrefix(path, abs+separator) {
|
if path == abs || strings.HasPrefix(path, abs+separator) {
|
||||||
return false
|
return false
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// file check
|
// file check
|
||||||
|
|
Loading…
Reference in New Issue