mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 11:31:54 +08:00
add global config switch for sharding
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
@ -190,15 +190,18 @@ func (adder *Adder) PinRoot() error {
|
||||
func (adder *Adder) Finalize() (node.Node, error) {
|
||||
root := adder.mr.GetValue()
|
||||
|
||||
// cant just call adder.RootNode() here as we need the name for printing
|
||||
rootNode, err := root.GetNode()
|
||||
err := root.Flush()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var name string
|
||||
if !adder.Wrap {
|
||||
name = rootNode.Links()[0].Name
|
||||
children, err := root.(*mfs.Directory).ListNames()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
name = children[0]
|
||||
|
||||
dir, ok := adder.mr.GetValue().(*mfs.Directory)
|
||||
if !ok {
|
||||
|
Reference in New Issue
Block a user