feat: make ls only work for directories

Long ago, `ls` was the _object_ (merkledag) level listing tool. That's no longer
the case.

This is a [breaking change] but I don't think anyone will object.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
This commit is contained in:
Steven Allen 2019-03-04 19:54:51 -08:00
parent 245c40b8fd
commit da44e21b95

View File

@ -160,9 +160,6 @@ func (api *UnixfsAPI) Ls(ctx context.Context, p coreiface.Path, opts ...options.
}
dir, err := uio.NewDirectoryFromNode(ses.dag, dagnode)
if err == uio.ErrNotADir {
return uses.lsFromLinks(ctx, dagnode.Links(), settings)
}
if err != nil {
return nil, err
}