mirror of
https://github.com/Slug-Boi/cocommit.git
synced 2026-05-13 12:45:47 +00:00
refactor: add env var for config location
This commit is contained in:
@@ -15,6 +15,7 @@ var ConfigVar *Config
|
||||
var (
|
||||
defaultConfigLocations = []string{
|
||||
"",
|
||||
os.Getenv("COCOMMIT_CONFIG"),
|
||||
os.Getenv("HOME") + "/.config/cocommit",
|
||||
os.Getenv("HOME") + "/cocommit",
|
||||
"/etc/cocommit",
|
||||
@@ -40,6 +41,8 @@ func init() {
|
||||
}
|
||||
|
||||
func LoadConfig() (*Config, error) {
|
||||
// TODO: create if and give param as default config location
|
||||
|
||||
v := viper.New()
|
||||
v.SetConfigName(configName)
|
||||
v.SetConfigType(configType)
|
||||
|
||||
Reference in New Issue
Block a user