增加 dirs规则

master
dengsgo 2019-01-08 15:49:21 +08:00
parent 4d0bc0886d
commit 0c5cd4a468
1 changed files with 4 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import (
"math/rand"
"os"
"path"
"strings"
"time"
)
@ -79,6 +80,9 @@ func addWatcher() {
if len(darr) < 1 || len(darr) > 2 {
log.Fatalln("filegirl section monitor dirs is error. ", cfg.Monitor.IncludeDirs[i])
}
if strings.HasPrefix(darr[0], "/") {
log.Fatalln("dirs must be relative paths ! err path:", cfg.Monitor.IncludeDirs[i])
}
if darr[0] == "." {
if len(darr) == 2 && darr[1] == "*" {
dirs = make([]string, 0)