Absolute path support for rules-dir config

This commit is contained in:
Soff authored and GitHub committed 2018-07-26 14:01:34 +08:00
1 parent 21923af1cd
commit 3939c01467
1 file changed
+3 -1
+3 -1
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 {