Absolute path support for rules-dir config

This commit is contained in:
Soff 2018-07-26 14:01:34 +08:00 committed by GitHub
parent 21923af1cd
commit 3939c01467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,9 @@ func confInit() {
}
if conf.RulesDir != "" {
conf.RulesDir = path.Join(flag.ConfDir(), conf.RulesDir)
if !path.IsAbs(conf.RulesDir) {
conf.RulesDir = path.Join(flag.ConfDir(), conf.RulesDir)
}
ruleFolderFiles, _ := listDir(conf.RulesDir, ".rule")
for _, ruleFile := range ruleFolderFiles {