1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 05:17:27 +00:00

Check for env var config file

This commit is contained in:
2019-10-24 09:04:25 -04:00
parent 439f09aa1c
commit 987eba51cf

View File

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