Make sure datapath exists to prevent error

This commit is contained in:
nytpu
2021-03-18 11:36:05 -06:00
parent 853993cdd6
commit 00de991f6b
+3
View File
@@ -48,6 +48,9 @@ func main() {
// dataPath is the location where all the data (list of subs, cached hashes,
// etcetera) are stored
dataPath := getDataPath()
// make sure it exists so we can start working with files in it
os.MkdirAll(dataPath, os.ModePerm)
err := core.Init(dataPath)
if err != nil {
fmt.Fprintf(os.Stderr, "Error in initialization: %v\n", err)