Ensure data directory exists

This commit is contained in:
Brian Brazil 2015-10-29 13:30:58 +00:00
parent 5770d3ec60
commit 4b6e0f4134
1 changed files with 4 additions and 0 deletions

View File

@ -55,6 +55,10 @@ func main() {
os.Exit(0)
}
err := os.MkdirAll(*dataDir, 0777)
if err != nil {
log.Fatal(err)
}
db, err := sql.Open("ql", filepath.Join(*dataDir, "am.db"))
if err != nil {
log.Fatal(err)