fstrigger build

This commit is contained in:
Sebastian Frank 2021-09-07 18:15:55 +02:00
parent b5b0615018
commit 9293458ef1
Signed by: apairon
GPG Key ID: A0E05A8199CE3F57

View File

@ -177,11 +177,14 @@ func startWatcher(directory *DirectoryConfig) {
directory._regexMatches = directory._regex.FindStringSubmatch(p) directory._regexMatches = directory._regex.FindStringSubmatch(p)
} }
if directory._regex == nil || directory._regexMatches != nil { if directory._regex == nil || directory._regexMatches != nil {
var statErr error var missing bool
if directory.IgnoreMissing { if directory.IgnoreMissing {
_, statErr = os.Stat(p) if _, statErr := os.Stat(p); os.IsNotExist(statErr) {
missing = true
log.Printf("[ INFO ] path=\"%s\" missing=\"true\"\n", p)
} }
if directory.IgnoreMissing || !os.IsNotExist(statErr) { }
if directory.IgnoreMissing || !missing {
for _, action := range directory.Actions { for _, action := range directory.Actions {
action.Directory = directory action.Directory = directory
contin, _ := runAction(&action, eventInfo, nil) contin, _ := runAction(&action, eventInfo, nil)