mirror of
https://github.com/42wim/matterbridge.git
synced 2024-11-22 02:32:02 -08:00
6aa05b3981
Bumps [github.com/spf13/viper](https://github.com/spf13/viper) from 1.9.0 to 1.10.1. - [Release notes](https://github.com/spf13/viper/releases) - [Commits](https://github.com/spf13/viper/compare/v1.9.0...v1.10.1) --- updated-dependencies: - dependency-name: github.com/spf13/viper dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
33 lines
662 B
Go
33 lines
662 B
Go
//go:build go1.16 && finder
|
|
// +build go1.16,finder
|
|
|
|
package viper
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/afero"
|
|
)
|
|
|
|
// Search all configPaths for any config file.
|
|
// Returns the first path that exists (and is a config file).
|
|
func (v *Viper) findConfigFile() (string, error) {
|
|
finder := finder{
|
|
paths: v.configPaths,
|
|
fileNames: []string{v.configName},
|
|
extensions: SupportedExts,
|
|
withoutExtension: v.configType != "",
|
|
}
|
|
|
|
file, err := finder.Find(afero.NewIOFS(v.fs))
|
|
if err != nil {
|
|
return "", err
|
|
}
|
|
|
|
if file == "" {
|
|
return "", ConfigFileNotFoundError{v.configName, fmt.Sprintf("%s", v.configPaths)}
|
|
}
|
|
|
|
return file, nil
|
|
}
|