diff --git a/main.go b/main.go index 4e55f45..6d38c30 100644 --- a/main.go +++ b/main.go @@ -23,7 +23,7 @@ var ( ) func main() { - conf = util.NewConfig() + conf = util.LoadConfig() tview.Borders.Horizontal = conf.Borders.Horizontal tview.Borders.Vertical = conf.Borders.Vertical diff --git a/util/config.go b/util/config.go index f84c0c2..29387c0 100644 --- a/util/config.go +++ b/util/config.go @@ -64,14 +64,15 @@ type Config struct { Borders borders `toml:"borders"` } -// NewConfig loads the configuration file, if the configuration file exists or creates a new one if not, and returns it. -func NewConfig() *Config { +// LoadConfig loads the configuration file, if the configuration file exists or creates a new one if not, and returns it. +func LoadConfig() *Config { configPath, err := os.UserConfigDir() if err != nil { panic(err) } configPath += "/discordo.toml" + var c Config if _, err = os.Stat(configPath); os.IsNotExist(err) { f, err := os.Create(configPath)