Commit a69056a1 authored by Johnny's avatar Johnny

fix: handle underscores in environment variables correctly

parent f827296d
...@@ -7,6 +7,7 @@ import ( ...@@ -7,6 +7,7 @@ import (
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"strings"
"syscall" "syscall"
"github.com/spf13/cobra" "github.com/spf13/cobra"
...@@ -131,6 +132,7 @@ func init() { ...@@ -131,6 +132,7 @@ func init() {
} }
viper.SetEnvPrefix("memos") viper.SetEnvPrefix("memos")
viper.SetEnvKeyReplacer(strings.NewReplacer("-", "_"))
viper.AutomaticEnv() viper.AutomaticEnv()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment