[#3896bk] Support using configuration param inline with other values

This commit is contained in:
Dane Everitt
2019-12-01 15:27:53 -08:00
parent 1be21b7078
commit 35cdff904f
2 changed files with 16 additions and 12 deletions

View File

@@ -14,7 +14,6 @@ import (
"gopkg.in/ini.v1"
"io/ioutil"
"os"
"regexp"
"strings"
)
@@ -28,15 +27,6 @@ const (
Xml = "xml"
)
// Regex to match anything that has a value matching the format of {{ config.$1 }} which
// will cause the program to lookup that configuration value from itself and set that
// value to the configuration one.
//
// This allows configurations to reference values that are node dependent, such as the
// internal IP address used by the daemon, useful in Bungeecord setups for example, where
// it is common to see variables such as "{{config.docker.interface}}"
var configMatchRegex = regexp.MustCompile(`^{{\s?config\.([\w.-]+)\s?}}$`)
type ConfigurationParser string
// Defines a configuration file for the server startup. These will be looped over