rename to repo path

fix FIXUP repo -> config
This commit is contained in:
Brian Tiger Chow 2015-01-30 15:06:45 -08:00
parent eeec8ab3d7
commit e45e153a93

View File

@ -220,15 +220,15 @@ func (i *cmdInvocation) Parse(ctx context.Context, args []string) error {
return err
}
configPath, err := getConfigRoot(i.req)
repoPath, err := getRepoPath(i.req)
if err != nil {
return err
}
log.Debugf("config path is %s", configPath)
log.Debugf("config path is %s", repoPath)
// this sets up the function that will initialize the config lazily.
cmdctx := i.req.Context()
cmdctx.ConfigRoot = configPath
cmdctx.ConfigRoot = repoPath
cmdctx.LoadConfig = loadConfig
// this sets up the function that will initialize the node
// this is so that we can construct the node lazily.
@ -415,20 +415,20 @@ func isClientError(err error) bool {
return false
}
func getConfigRoot(req cmds.Request) (string, error) {
configOpt, found, err := req.Option("config").String()
func getRepoPath(req cmds.Request) (string, error) {
repoOpt, found, err := req.Option("config").String()
if err != nil {
return "", err
}
if found && configOpt != "" {
return configOpt, nil
if found && repoOpt != "" {
return repoOpt, nil
}
configPath, err := config.PathRoot()
repoPath, err := fsrepo.BestKnownPath()
if err != nil {
return "", err
}
return configPath, nil
return repoPath, nil
}
func loadConfig(path string) (*config.Config, error) {