|
@@ -2,6 +2,7 @@ package config
|
|
|
|
|
|
|
|
import (
|
|
import (
|
|
|
"fmt"
|
|
"fmt"
|
|
|
|
|
+ "path"
|
|
|
"regexp"
|
|
"regexp"
|
|
|
"strconv"
|
|
"strconv"
|
|
|
|
|
|
|
@@ -94,6 +95,8 @@ func NewConfig(options options.Options) (Config, error) {
|
|
|
var err error
|
|
var err error
|
|
|
if options.Config != "" {
|
|
if options.Config != "" {
|
|
|
_, err = toml.DecodeFile(options.Config, &tomlLoader)
|
|
_, err = toml.DecodeFile(options.Config, &tomlLoader)
|
|
|
|
|
+ // append a whitelist rule for whitelisting the config
|
|
|
|
|
+ tomlLoader.Whitelist.Files = append(tomlLoader.Whitelist.Files, path.Base(options.Config))
|
|
|
} else {
|
|
} else {
|
|
|
_, err = toml.Decode(DefaultConfig, &tomlLoader)
|
|
_, err = toml.Decode(DefaultConfig, &tomlLoader)
|
|
|
}
|
|
}
|