Update full path to config file

This commit is contained in:
Alexey Khit
2023-01-15 09:55:32 +03:00
parent 463d05dfd3
commit d1e56feeb6
+4 -3
View File
@@ -8,6 +8,7 @@ import (
"gopkg.in/yaml.v3" "gopkg.in/yaml.v3"
"io" "io"
"os" "os"
"path"
"runtime" "runtime"
"strings" "strings"
) )
@@ -51,6 +52,9 @@ func Init() {
} }
if ConfigPath != "" { if ConfigPath != "" {
if cwd, err := os.Getwd(); err == nil {
ConfigPath = path.Join(cwd, ConfigPath)
}
Info["config_path"] = ConfigPath Info["config_path"] = ConfigPath
} }
@@ -65,9 +69,6 @@ func Init() {
modules = cfg.Mod modules = cfg.Mod
log.Info().Msgf("go2rtc version %s %s/%s", Version, runtime.GOOS, runtime.GOARCH) log.Info().Msgf("go2rtc version %s %s/%s", Version, runtime.GOOS, runtime.GOARCH)
path, _ := os.Getwd()
log.Debug().Str("cwd", path).Send()
} }
func NewLogger(format string, level string) zerolog.Logger { func NewLogger(format string, level string) zerolog.Logger {