Browse Source

Feature #17 - load ~/.config/kbtui.toml if it exists, otherwise use toml in dir

rudi9719/bugs/editing-nontext-messages
Gregory Rudolph 5 years ago
parent
commit
1a75ac8a49
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 4
      cmdSet.go

4
cmdSet.go

@ -69,8 +69,12 @@ func cmdSet(cmd []string) { @@ -69,8 +69,12 @@ func cmdSet(cmd []string) {
func loadFromToml() {
configFile, env := os.LookupEnv("KBTUI_CFG")
if !env {
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)
if err != nil {

Loading…
Cancel
Save