feature: add replacer for ENV vars
This commit is contained in:
parent
a356402276
commit
9eb61392a1
1 changed files with 3 additions and 0 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue