From 5b982a51709798aad09fecdfc9b645165f85ba78 Mon Sep 17 00:00:00 2001 From: Anjor Kanekar Date: Mon, 1 May 2023 19:28:19 +0100 Subject: [PATCH] fix (#21) --- cmd/data-prep/fil-data-prep/fil-data-prep.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/data-prep/fil-data-prep/fil-data-prep.go b/cmd/data-prep/fil-data-prep/fil-data-prep.go index 3b9663f..6adea6f 100644 --- a/cmd/data-prep/fil-data-prep/fil-data-prep.go +++ b/cmd/data-prep/fil-data-prep/fil-data-prep.go @@ -96,11 +96,11 @@ func filDataPrep(c *cli.Context) error { tr := constructTree(files, rs) nodes := getDirectoryNodes(tr) - if len(paths) > 1 { + if len(nodes) == 1 || len(paths) > 1 { // len(nodes) = 1 means a file was passed as input rcid = nodes[0].Cid() // use fake root directory if multiple args writeNode(nodes, wout) } else { - rcid = nodes[1].Cid() // otherwise use the first node (which should work) todo: check this + rcid = nodes[1].Cid() // otherwise use the first node (which should work) writeNode(nodes[1:], wout) } }()