Watch config for changes and apply automatically

This commit is contained in:
Elara 2021-08-21 03:07:48 -07:00
parent 60d2053894
commit 4a195f8311

View File

@ -40,6 +40,7 @@ func init() {
viper.AddConfigPath("$HOME/.config") viper.AddConfigPath("$HOME/.config")
viper.SetConfigName("itd") viper.SetConfigName("itd")
viper.SetConfigType("toml") viper.SetConfigType("toml")
viper.WatchConfig()
viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_"))
viper.SetEnvPrefix("itd") viper.SetEnvPrefix("itd")
if err := viper.ReadInConfig(); err != nil { if err := viper.ReadInConfig(); err != nil {