refactor(init) re-order
Brian Tiger Chow committed
Nov 4, 2014 at 04:06 UTC
46f1afbe083ec0f18490c3352b3d2aa379cec7ea
1 file changed
+4
-3
cmd/ipfs2/init.go
+4
-3
@@ -77,15 +77,16 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
77
}
78
cfg := new(config.Config)
79
80
- cfg.Datastore = config.Datastore{}
80
if len(dspath) == 0 {
81
dspath, err = config.DataStorePath("")
82
if err != nil {
83
return err
84
}
85
}
87
- cfg.Datastore.Path = dspath
88
- cfg.Datastore.Type = "leveldb"
86
+ cfg.Datastore = config.Datastore{
87
+ Path: dspath,
88
+ Type: "leveldb",
89
+ }
90
91
// Construct the data store if missing
92
if err := os.MkdirAll(dspath, os.ModePerm); err != nil {