From 3939c014679353519eee3768c5c4d7a2ef230ce8 Mon Sep 17 00:00:00 2001 From: Soff Date: Thu, 26 Jul 2018 14:01:34 +0800 Subject: [PATCH] Absolute path support for rules-dir config --- conf.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conf.go b/conf.go index a088936..df2e847 100644 --- a/conf.go +++ b/conf.go @@ -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 {