Merge pull request #39 from soffchen/patch-4

Absolute path support for rules-dir config
This commit is contained in:
nadoo 2018-07-26 22:17:03 +08:00 committed by GitHub
commit b2a4039c1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,9 @@ func confInit() {
} }
if conf.RulesDir != "" { 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") ruleFolderFiles, _ := listDir(conf.RulesDir, ".rule")
for _, ruleFile := range ruleFolderFiles { for _, ruleFile := range ruleFolderFiles {