Skip to content

Commit

Permalink
Store store on data path
Browse files Browse the repository at this point in the history
  • Loading branch information
pipe01 committed Feb 9, 2021
1 parent ca96041 commit a4a1a23
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package main
import (
"flag"
"log"
"os"
"path/filepath"

"github.com/MouseHatGames/hat/internal/config"
"github.com/MouseHatGames/hat/internal/server"
Expand All @@ -18,7 +20,9 @@ func main() {
log.Fatalf("failed to load config: %s", err)
}

store, err := store.NewStore("store.db")
os.MkdirAll(config.DataPath, 0)

store, err := store.NewStore(filepath.Join(config.DataPath, "store.db"))
if err != nil {
log.Fatalf("failed to create store: %s", err)
}
Expand Down

0 comments on commit a4a1a23

Please sign in to comment.