From 987eba51cf733e307e0383d91b58e8da9b9f5044 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 24 Oct 2019 09:04:25 -0400 Subject: [PATCH] Check for env var config file --- cmdSet.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmdSet.go b/cmdSet.go index b0e3121..565ddd2 100644 --- a/cmdSet.go +++ b/cmdSet.go @@ -4,6 +4,7 @@ package main import ( "fmt" + "os" "strings" "github.com/pelletier/go-toml" @@ -67,7 +68,12 @@ func cmdSet(cmd []string) { } func loadFromToml() { - config, err := toml.LoadFile("kbtui.tml") + configFile, env := os.LookupEnv("KBTUI_CFG") + if !env { + configFile = "kbtui.toml" + } + + config, err := toml.LoadFile(configFile) if err != nil { printError(fmt.Sprintf("Could not read config file: %+v", err)) return