Commit ee1d1ac0 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

add: only show added once.

parent 0c8ae767
......@@ -36,7 +36,7 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
}
// Add the file
nd, err := AddPath(n, path, depth)
_, err = AddPath(n, path, depth)
if err != nil {
if err == ErrDepthLimitExceeded && depth == 1 {
err = errors.New("use -r to recursively add directories")
......@@ -45,12 +45,13 @@ func Add(n *core.IpfsNode, args []string, opts map[string]interface{}, out io.Wr
}
// get the key to print it
k, err := nd.Key()
if err != nil {
return fmt.Errorf("addFile error: %v", err)
}
fmt.Fprintf(out, "added %s %s\n", k.Pretty(), path)
// k, err := nd.Key()
// if err != nil {
// return fmt.Errorf("addFile error: %v", err)
// }
//
// Commenting out of here, because it's already in addNode below.
// fmt.Fprintf(out, "added %s %s\n", k.Pretty(), path)
}
return nil
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment