Create config dir if does not exist (#54)

Closes #53
This commit is contained in:
ayntgl 2021-09-24 11:53:43 +04:00 • committed by GitHub
parent e43a631950
commit 6140d67250

View file

@ -41,6 +41,11 @@ func LoadConfig() *Config {
configPath := u + "/.config/discordo/config.json"
if _, err = os.Stat(configPath); os.IsNotExist(err) {
err = os.MkdirAll(u+"/.config/discordo", 0700)
if err != nil {
panic(err)
}
f, err := os.Create(configPath)
if err != nil {
panic(err)