From 74cf0ee1c1979c4e79a60fc584ba81160af1ccdb Mon Sep 17 00:00:00 2001 From: Deluan Date: Fri, 10 Jul 2020 21:43:09 -0400 Subject: [PATCH] Create Data Folder if it does not exist --- conf/configuration.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conf/configuration.go b/conf/configuration.go index 736e8d4eb..01172399a 100644 --- a/conf/configuration.go +++ b/conf/configuration.go @@ -53,6 +53,11 @@ func Load() { fmt.Println("Error parsing config:", err) os.Exit(1) } + err = os.MkdirAll(Server.DataFolder, os.ModePerm) + if err != nil { + fmt.Println("Error creating data path:", "path", Server.DataFolder, err) + os.Exit(1) + } Server.ConfigFile = viper.GetViper().ConfigFileUsed() if Server.DbPath == "" { Server.DbPath = filepath.Join(Server.DataFolder, consts.DefaultDbPath)