From 0d76fede84eb96d99918350a6d86895723fdeae9 Mon Sep 17 00:00:00 2001 From: peolic <66393006+peolic@users.noreply.github.com> Date: Fri, 12 Nov 2021 23:05:05 +0200 Subject: [PATCH] Fix config path regression (#1996) --- pkg/manager/config/init.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/manager/config/init.go b/pkg/manager/config/init.go index 3b0d00a6a..0b2ddb6b8 100644 --- a/pkg/manager/config/init.go +++ b/pkg/manager/config/init.go @@ -5,6 +5,7 @@ import ( "fmt" "net" "os" + "path/filepath" "sync" "github.com/spf13/pflag" @@ -72,8 +73,8 @@ func initConfig(instance *Instance, flags flagStruct) error { // The config file is called config. Leave off the file extension. v.SetConfigName("config") - v.AddConfigPath(".") // Look for config in the working directory - v.AddConfigPath("$HOME/.stash") // Look for the config in the home directory + v.AddConfigPath(".") // Look for config in the working directory + v.AddConfigPath(filepath.FromSlash("$HOME/.stash")) // Look for the config in the home directory configFile := "" envConfigFile := os.Getenv("STASH_CONFIG_FILE")