1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00
wtf/modules/cmdrunner/settings.go
2019-04-16 21:52:10 -07:00

28 lines
498 B
Go

package cmdrunner
import (
"github.com/olebedev/config"
"github.com/wtfutil/wtf/cfg"
"github.com/wtfutil/wtf/wtf"
)
type Settings struct {
common *cfg.Common
args []string
cmd string
}
func NewSettingsFromYAML(ymlConfig *config.Config) *Settings {
localConfig, _ := ymlConfig.Get("wtf.mods.cmdrunner")
settings := Settings{
common: cfg.NewCommonSettingsFromYAML(ymlConfig),
args: wtf.ToStrs(localConfig.UList("args")),
cmd: localConfig.UString("cmd"),
}
return &settings
}