@cryptotaxi247 / kubo / commits / 80c2e9769

refactor(main): use fsrepo to load config

Brian Tiger Chow committed Jan 12, 2015 at 17:03 UTC 80c2e976924e7b736ce90c050c7da60d0289dd32
1 file changed +4 -4
cmd/ipfs/main.go
+4 -4
@@ -445,12 +445,12 @@ func getConfigRoot(req cmds.Request) (string, error) {
445 }
446
447 func loadConfig(path string) (*config.Config, error) {
448 - configFile, err := config.Filename(path)
449 - if err != nil {
448 + r := fsrepo.At(path)
449 + if err := r.Open(); err != nil {
450 return nil, err
451 }
452 -
453 - return fsrepo.Load(configFile)
452 + defer r.Close()
453 + return r.Config(), nil
454 }
455
456 // startProfiling begins CPU profiling and returns a `stop` function to be