1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 18:13:54 +08:00

refactor(init) re-order

This commit is contained in:
Brian Tiger Chow
2014-11-04 04:06:47 -08:00
committed by Juan Batiz-Benet
parent a1e738e297
commit 46f1afbe08

View File

@ -77,15 +77,16 @@ func doInit(configRoot string, dspath string, force bool, nBitsForKeypair int) e
}
cfg := new(config.Config)
cfg.Datastore = config.Datastore{}
if len(dspath) == 0 {
dspath, err = config.DataStorePath("")
if err != nil {
return err
}
}
cfg.Datastore.Path = dspath
cfg.Datastore.Type = "leveldb"
cfg.Datastore = config.Datastore{
Path: dspath,
Type: "leveldb",
}
// Construct the data store if missing
if err := os.MkdirAll(dspath, os.ModePerm); err != nil {