Skip to content

Commit

Permalink
Create Data Folder if it does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Jul 12, 2020
1 parent c2f40ea commit 74cf0ee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions conf/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 74cf0ee

Please sign in to comment.