From 100b5856636190907eb5265c5333e23c6cb545e7 Mon Sep 17 00:00:00 2001 From: Ryan Cavicchioni Date: Wed, 31 Mar 2021 00:19:03 -0500 Subject: [PATCH] Add ~/.config/lume/lume.conf to configuration file search paths --- cmd/config.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cmd/config.go b/cmd/config.go index 1dc5312..c77a26e 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -11,6 +11,7 @@ import ( ) const lumercFile string = ".lumerc" +const lumeConfigFile string = "lume.conf" type Config struct { AccessToken string `toml:"access_token"` @@ -122,6 +123,15 @@ func getConfigPath() string { } } + // ~/.config/lume/lume.conf + homeDir, err = os.UserHomeDir() + if err == nil { + tryPath = path.Join(homeDir, ".config/lume", lumeConfigFile) + if _, err := os.Stat(tryPath); !os.IsNotExist(err) { + configPath = tryPath + } + } + // ./.lumerc cwd, err = os.Getwd() if err == nil {