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,
|
// dataPath is the location where all the data (list of subs, cached hashes,
|
||||||
// etcetera) are stored
|
// etcetera) are stored
|
||||||
dataPath := getDataPath()
|
dataPath := getDataPath()
|
||||||
|
// make sure it exists so we can start working with files in it
|
||||||
|
os.MkdirAll(dataPath, os.ModePerm)
|
||||||
|
|
||||||
err := core.Init(dataPath)
|
err := core.Init(dataPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Fprintf(os.Stderr, "Error in initialization: %v\n", err)
|
fmt.Fprintf(os.Stderr, "Error in initialization: %v\n", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user