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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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")