From 1a75ac8a4993b1c0f165b34cb990b8bbcd83f934 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 24 Oct 2019 09:51:22 -0400 Subject: [PATCH] Feature #17 - load ~/.config/kbtui.toml if it exists, otherwise use toml in dir --- cmdSet.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmdSet.go b/cmdSet.go index ab3ec9d..812fb48 100644 --- a/cmdSet.go +++ b/cmdSet.go @@ -69,7 +69,11 @@ func cmdSet(cmd []string) { func loadFromToml() { configFile, env := os.LookupEnv("KBTUI_CFG") if !env { - configFile = "kbtui.toml" + configFile = "~/.config/kbtui.toml" + if _, err := os.Stat(configFile); os.IsNotExist(err) { + configFile = "kbtui.toml" + } + } printInfoF("Loading config from toml: $TEXT", messageAttachmentColor.stylize(configFile)) config, err := toml.LoadFile(configFile)