config: Make fs.ConfigFileGet return an exists flag

This commit is contained in:
Nick Craig-Wood
2018-05-21 14:53:45 +01:00
parent 85d09729f2
commit 3c89406886
3 changed files with 18 additions and 4 deletions

View File

@@ -790,9 +790,10 @@ func MustFind(name string) *RegInfo {
func ParseRemote(path string) (fsInfo *RegInfo, configName, fsPath string, err error) {
configName, fsPath = fspath.Parse(path)
var fsName string
var ok bool
if configName != "" {
fsName = ConfigFileGet(configName, "type")
if fsName == "" {
fsName, ok = ConfigFileGet(configName, "type")
if !ok {
return nil, "", "", ErrorNotFoundInConfigFile
}
} else {