From fee2de55479c0b57fc7b55b08a8eae05c5df16ff Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Tue, 5 Nov 2019 08:32:52 +1100 Subject: [PATCH] Use custom.css is same path as config file (#175) --- pkg/manager/config/config.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/manager/config/config.go b/pkg/manager/config/config.go index 26e376cad..fee8e3397 100644 --- a/pkg/manager/config/config.go +++ b/pkg/manager/config/config.go @@ -4,6 +4,7 @@ import ( "golang.org/x/crypto/bcrypt" "io/ioutil" + "path/filepath" "github.com/spf13/viper" @@ -123,12 +124,11 @@ func ValidateCredentials(username string, password string) bool { } func GetCSSPath() string { - // search for custom.css in current directory, then $HOME/.stash - fn := "custom.css" - exists, _ := utils.FileExists(fn) - if !exists { - fn = "$HOME/.stash/" + fn - } + // use custom.css in the same directory as the config file + configFileUsed := viper.ConfigFileUsed() + configDir := filepath.Dir(configFileUsed) + + fn := filepath.Join(configDir, "custom.css") return fn }