fix(config): fix config path check
This commit is contained in:
parent
c8ed7aa7e8
commit
3eb4ecce5d
|
@ -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)
|
||||
|
|
Reference in New Issue