Fix config path regression (#1996)

This commit is contained in:
peolic
2021-11-12 23:05:05 +02:00
committed by GitHub
parent 2c7e0f0571
commit 0d76fede84

View File

@@ -5,6 +5,7 @@ import (
"fmt" "fmt"
"net" "net"
"os" "os"
"path/filepath"
"sync" "sync"
"github.com/spf13/pflag" "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. // The config file is called config. Leave off the file extension.
v.SetConfigName("config") v.SetConfigName("config")
v.AddConfigPath(".") // Look for config in the working directory v.AddConfigPath(".") // Look for config in the working directory
v.AddConfigPath("$HOME/.stash") // Look for the config in the home directory v.AddConfigPath(filepath.FromSlash("$HOME/.stash")) // Look for the config in the home directory
configFile := "" configFile := ""
envConfigFile := os.Getenv("STASH_CONFIG_FILE") envConfigFile := os.Getenv("STASH_CONFIG_FILE")