提交 46f1afbe 作者: Brian Tiger Chow 提交者: Juan Batiz-Benet

refactor(init) re-order

上级 a1e738e2
......@@ -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 {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论