mirror of
https://github.com/nadoo/glider.git
synced 2025-02-23 01:15:41 +08:00
conf: support relative path in "rules-dir" config
This commit is contained in:
parent
1a941cd095
commit
419fa05171
4
conf.go
4
conf.go
@ -4,6 +4,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path"
|
||||
|
||||
"github.com/nadoo/conflag"
|
||||
)
|
||||
@ -66,8 +67,9 @@ func confInit() {
|
||||
conf.rules = append(conf.rules, rule)
|
||||
}
|
||||
|
||||
// TODO: allow to use relative dir to the config file
|
||||
conf.RulesDir = path.Join(flag.ConfDir(), conf.RulesDir)
|
||||
ruleFolderFiles, _ := listDir(conf.RulesDir, ".rule")
|
||||
|
||||
for _, ruleFile := range ruleFolderFiles {
|
||||
rule, err := NewRuleConfFromFile(ruleFile)
|
||||
if err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user