Update Config to use abs path if supplied

This commit is contained in:
Matt Krump 2017-11-07 09:39:44 -06:00 committed by Eric Meyer
parent d3946e27d8
commit cdc861e5f2

View File

@ -23,7 +23,9 @@ func NewConfig(environment string) Config {
filenameWithExtension := fmt.Sprintf("%s.toml", environment)
absolutePath := filepath.Join(ProjectRoot(), "pkg", "config", "environments", filenameWithExtension)
config := parseConfigFile(absolutePath)
config.Client.IPCPath = filepath.Join(ProjectRoot(), config.Client.IPCPath)
if !filepath.IsAbs(config.Client.IPCPath) {
config.Client.IPCPath = filepath.Join(ProjectRoot(), config.Client.IPCPath)
}
return config
}