Create Data Folder if it does not exist
This commit is contained in:
parent
c2f40ea8a3
commit
74cf0ee1c1
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue