Make sure datapath exists to prevent error
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user