From 9214f706a1fbaa9129cae3bd33f9806f615e44df Mon Sep 17 00:00:00 2001 From: hannahhoward Date: Mon, 7 Mar 2022 16:29:24 +0000 Subject: [PATCH] fix(unixfsnode): add unixfs to path tail fix the selector for paths, wrapping the last matcher node in an ExploreInterpretAs, since the tail end of a path into a unixfs dir is itself a unixfsnode --- signaling.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/signaling.go b/signaling.go index a2dee3d..56eb52d 100644 --- a/signaling.go +++ b/signaling.go @@ -22,7 +22,7 @@ func AddUnixFSReificationToLinkSystem(lsys *ipld.LinkSystem) { func UnixFSPathSelector(path string) datamodel.Node { segments := strings.Split(path, "/") ssb := builder.NewSelectorSpecBuilder(basicnode.Prototype.Any) - selectorSoFar := ssb.Matcher() + selectorSoFar := ssb.ExploreInterpretAs("unixfs", ssb.Matcher()) for i := len(segments) - 1; i >= 0; i-- { selectorSoFar = ssb.ExploreInterpretAs("unixfs", ssb.ExploreFields(func(efsb builder.ExploreFieldsSpecBuilder) {