Commit 7d53e736 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

cmd/ipfs: Added getConfig function

parent cf60fdd3
......@@ -43,13 +43,7 @@ func daemonFunc(req cmds.Request, res cmds.Response) {
}
defer lk.Close()
configFile, err := config.Filename(configPath)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
}
config, err := config.Load(configFile)
config, err := getConfig(configPath)
if err != nil {
res.SetError(err, cmds.ErrNormal)
return
......
......@@ -149,3 +149,12 @@ func getConfigPath(req cmds.Request) (string, error) {
}
return configPath, nil
}
func getConfig(path string) (*config.Config, error) {
configFile, err := config.Filename(path)
if err != nil {
return nil, err
}
return config.Load(configFile)
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment