1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

Allow duplicates of modules

This leverages the recent config changes, extending it so that config is literally using passed config, rather than
passed config value
Uses cmdRunner as an example for #181
Because config turns into a map, names are the root keys, and an optional type is provided
This commit is contained in:
Sean Smith
2019-04-27 12:15:55 -04:00
parent 378cce8726
commit 3a96c303a8
2 changed files with 52 additions and 50 deletions

View File

@@ -15,13 +15,13 @@ type Settings struct {
cmd string
}
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
func NewSettingsFromYAML(name string, moduleConfig *config.Config, globalConfig *config.Config) *Settings {
settings := Settings{
common: cfg.NewCommonSettingsFromModule(name, ymlConfig, globalConfig),
common: cfg.NewCommonSettingsFromModule(name, moduleConfig, globalConfig),
args: wtf.ToStrs(ymlConfig.UList("args")),
cmd: ymlConfig.UString("cmd"),
args: wtf.ToStrs(moduleConfig.UList("args")),
cmd: moduleConfig.UString("cmd"),
}
return &settings