From d1e56feeb64e1ae8a65e237b8e3e80b84481af8b Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Sun, 15 Jan 2023 09:55:32 +0300 Subject: [PATCH] Update full path to config file --- cmd/app/app.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/app/app.go b/cmd/app/app.go index 438b504c..776aee4a 100644 --- a/cmd/app/app.go +++ b/cmd/app/app.go @@ -8,6 +8,7 @@ import ( "gopkg.in/yaml.v3" "io" "os" + "path" "runtime" "strings" ) @@ -51,6 +52,9 @@ func Init() { } if ConfigPath != "" { + if cwd, err := os.Getwd(); err == nil { + ConfigPath = path.Join(cwd, ConfigPath) + } Info["config_path"] = ConfigPath } @@ -65,9 +69,6 @@ func Init() { modules = cfg.Mod 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 {