diff --git a/core/commands/ls.go b/core/commands/ls.go index 016116cf07c..0289d69fd34 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -22,6 +22,7 @@ type LsLink struct { Name, Hash string Size uint64 Type unixfs_pb.Data_DataType + Target string } // LsObject is an element of LsOutput @@ -159,8 +160,9 @@ The JSON output contains type information. Name: link.Name, Hash: enc.Encode(link.Cid), - Size: link.Size, - Type: ftype, + Size: link.Size, + Type: ftype, + Target: link.Target, } if err := processLink(paths[i], lsLink); err != nil { return err diff --git a/core/coreapi/unixfs.go b/core/coreapi/unixfs.go index 627a6d06eab..e26c755b935 100644 --- a/core/coreapi/unixfs.go +++ b/core/coreapi/unixfs.go @@ -209,6 +209,7 @@ func (api *UnixfsAPI) processLink(ctx context.Context, linkres ft.LinkResult, se lnk.Type = coreiface.TDirectory case ft.TSymlink: lnk.Type = coreiface.TSymlink + lnk.Target = string(d.Data()) } lnk.Size = d.FileSize() }