From 4b6e0f4134c970b312db20419967a887d309cc7c Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Thu, 29 Oct 2015 13:30:58 +0000 Subject: [PATCH] Ensure data directory exists --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 5454defa..174ff152 100644 --- a/main.go +++ b/main.go @@ -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)