Add ~/.config/lume/lume.conf to configuration file search paths
This commit is contained in:
		@@ -11,6 +11,7 @@ import (
 | 
				
			|||||||
)
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const lumercFile string = ".lumerc"
 | 
					const lumercFile string = ".lumerc"
 | 
				
			||||||
 | 
					const lumeConfigFile string = "lume.conf"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
type Config struct {
 | 
					type Config struct {
 | 
				
			||||||
	AccessToken  string               `toml:"access_token"`
 | 
						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
 | 
						// ./.lumerc
 | 
				
			||||||
	cwd, err = os.Getwd()
 | 
						cwd, err = os.Getwd()
 | 
				
			||||||
	if err == nil {
 | 
						if err == nil {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user