@cryptotaxi247 / kubo / commits / e45e153a9

rename to repo path

fix FIXUP repo -> config

Brian Tiger Chow committed Jan 30, 2015 at 15:06 UTC e45e153a9308898655a691924a3667561e99382f
1 file changed +9 -9
cmd/ipfs/main.go
+9 -9
@@ -220,15 +220,15 @@ func (i *cmdInvocation) Parse(ctx context.Context, args []string) error {
220 return err
221 }
222
223 - configPath, err := getConfigRoot(i.req)
223 + repoPath, err := getRepoPath(i.req)
224 if err != nil {
225 return err
226 }
227 - log.Debugf("config path is %s", configPath)
227 + log.Debugf("config path is %s", repoPath)
228
229 // this sets up the function that will initialize the config lazily.
230 cmdctx := i.req.Context()
231 - cmdctx.ConfigRoot = configPath
231 + cmdctx.ConfigRoot = repoPath
232 cmdctx.LoadConfig = loadConfig
233 // this sets up the function that will initialize the node
234 // this is so that we can construct the node lazily.
@@ -415,20 +415,20 @@ func isClientError(err error) bool {
415 return false
416 }
417
418 -func getConfigRoot(req cmds.Request) (string, error) {
419 - configOpt, found, err := req.Option("config").String()
418 +func getRepoPath(req cmds.Request) (string, error) {
419 + repoOpt, found, err := req.Option("config").String()
420 if err != nil {
421 return "", err
422 }
423 - if found && configOpt != "" {
424 - return configOpt, nil
423 + if found && repoOpt != "" {
424 + return repoOpt, nil
425 }
426
427 - configPath, err := config.PathRoot()
427 + repoPath, err := fsrepo.BestKnownPath()
428 if err != nil {
429 return "", err
430 }
431 - return configPath, nil
431 + return repoPath, nil
432 }
433
434 func loadConfig(path string) (*config.Config, error) {