From 9eb61392a10538cf04218228510187f3990f08a7 Mon Sep 17 00:00:00 2001 From: Victor Lacasse-Beaudoin Date: Mon, 19 Feb 2024 12:11:41 -0500 Subject: [PATCH] feature: add replacer for ENV vars --- cmd/root.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 92c2a9a..73f9e75 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -3,6 +3,7 @@ package cmd import ( "fmt" "os" + "strings" "codeberg.org/vlbeaudoin/serpents" "github.com/spf13/cobra" @@ -138,6 +139,8 @@ func initConfig() { viper.SetConfigName(".bottin-agenda") } + viper.SetEnvPrefix("BOTTINAGENDA") + viper.SetEnvKeyReplacer(strings.NewReplacer(".", "_")) viper.AutomaticEnv() // read in environment variables that match // If a config file is found, read it in. -- 2.45.2