mirror of
https://github.com/mje-nz/zerotier-dns.git
synced 2024-05-11 05:55:15 +00:00
Fixing Viper config parsing logic
This commit is contained in:
@ -45,12 +45,13 @@ func init() {
|
||||
func initConfig() {
|
||||
if cfgFile != "" { // enable ability to specify config file via flag
|
||||
viper.SetConfigFile(cfgFile)
|
||||
} else {
|
||||
viper.SetConfigName(".ztdns") // name of config file (without extension)
|
||||
viper.AddConfigPath(".") // adding current directory as first search path
|
||||
viper.AddConfigPath("$HOME") // adding home directory as second search path
|
||||
}
|
||||
}
|
||||
|
||||
viper.SetConfigName(".ztdns") // name of config file (without extension)
|
||||
viper.AddConfigPath(".") // adding current directory as first search path
|
||||
viper.AddConfigPath("$HOME") // adding home directory as second search path
|
||||
|
||||
viper.SetEnvPrefix("ztdns")
|
||||
viper.AutomaticEnv() // read in environment variables that match
|
||||
|
||||
|
Reference in New Issue
Block a user