fix(config): fix config path check

This commit is contained in:
DataHearth 2022-02-27 14:00:00 +01:00
parent c8ed7aa7e8
commit 3eb4ecce5d
1 changed files with 0 additions and 7 deletions

View File

@ -4,7 +4,6 @@ import (
"fmt"
"os"
"path"
"strings"
"github.com/pterm/pterm"
"github.com/spf13/viper"
@ -57,15 +56,9 @@ func InitConfig() {
}
if c := viper.GetString("configuration-file"); c != "" {
if strings.Contains(c, ".yml") {
c = path.Dir(c)
}
viper.AddConfigPath(path.Dir(c))
}
if c := os.Getenv("CONFIG_MAPPER_CFG"); c != "" {
if strings.Contains(c, ".yml") {
c = path.Dir(c)
}
viper.AddConfigPath(c)
}
viper.AddConfigPath(h)