Create Data Folder if it does not exist
This commit is contained in:
@@ -53,6 +53,11 @@ func Load() {
|
|||||||
fmt.Println("Error parsing config:", err)
|
fmt.Println("Error parsing config:", err)
|
||||||
os.Exit(1)
|
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()
|
Server.ConfigFile = viper.GetViper().ConfigFileUsed()
|
||||||
if Server.DbPath == "" {
|
if Server.DbPath == "" {
|
||||||
Server.DbPath = filepath.Join(Server.DataFolder, consts.DefaultDbPath)
|
Server.DbPath = filepath.Join(Server.DataFolder, consts.DefaultDbPath)
|
||||||
|
|||||||
Reference in New Issue
Block a user