storageminer: Create dir with --init

This commit is contained in:
Łukasz Magiera 2020-03-09 23:00:29 +01:00
parent 24956a49f4
commit 0c3f4eb7dd

View File

@ -65,6 +65,12 @@ var storageAttachCmd = &cli.Command{
}
if cctx.Bool("init") {
if err := os.MkdirAll(p, 0755); err != nil {
if !os.IsExist(err) {
return err
}
}
_, err := os.Stat(filepath.Join(p, metaFile))
if !os.IsNotExist(err) {
if err == nil {