mirror of
https://github.com/ipfs/kubo.git
synced 2025-06-19 01:39:35 +08:00
display key if BlockPut is successful
This commit is contained in:
@ -45,8 +45,11 @@ func BlockPut(n *core.IpfsNode, args []string, opts map[string]interface{}, out
|
|||||||
b := blocks.NewBlock(data)
|
b := blocks.NewBlock(data)
|
||||||
log.Debug("BlockPut key: '%q'", b.Key())
|
log.Debug("BlockPut key: '%q'", b.Key())
|
||||||
|
|
||||||
_, err = n.Blocks.AddBlock(b)
|
k, err := n.Blocks.AddBlock(b)
|
||||||
log.Debug("BlockPut Done. Err: %q", err)
|
if err != nil {
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
fmt.Fprintf(out, "added as '%s'\n", k)
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user