mirror of
https://github.com/Rudi9719/kbtui.git
synced 2026-03-22 12:07:23 +00:00
Feature #17 - load ~/.config/kbtui.toml if it exists, otherwise use toml in dir
This commit is contained in:
@ -69,7 +69,11 @@ func cmdSet(cmd []string) {
|
|||||||
func loadFromToml() {
|
func loadFromToml() {
|
||||||
configFile, env := os.LookupEnv("KBTUI_CFG")
|
configFile, env := os.LookupEnv("KBTUI_CFG")
|
||||||
if !env {
|
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))
|
printInfoF("Loading config from toml: $TEXT", messageAttachmentColor.stylize(configFile))
|
||||||
config, err := toml.LoadFile(configFile)
|
config, err := toml.LoadFile(configFile)
|
||||||
|
|||||||
Reference in New Issue
Block a user