diff --git a/cmd/generate-ipld-car/util/generate-ipld.go b/cmd/generate-ipld-car/util/generate-ipld.go index ee61edb..e636c10 100644 --- a/cmd/generate-ipld-car/util/generate-ipld.go +++ b/cmd/generate-ipld-car/util/generate-ipld.go @@ -16,7 +16,6 @@ import ( "github.com/ipld/go-car" "github.com/pkg/errors" "io" - "path/filepath" "strings" ) @@ -137,7 +136,7 @@ func GenerateIpldCar(ctx context.Context, input io.Reader, writer io.Writer) (ci } relPath := finfo.Path - relSegments := strings.Split(relPath, string(filepath.Separator)) + relSegments := strings.Split(relPath, "/") pos := &rootDir for i, seg := range relSegments { last := i == len(relSegments)-1 diff --git a/spec/generate-car_spec.rb b/spec/generate-car_spec.rb index 896c3be..101b1d0 100644 --- a/spec/generate-car_spec.rb +++ b/spec/generate-car_spec.rb @@ -71,7 +71,7 @@ def importToIpfs(path) end end - out = `./generate-ipld-car -i test_output/test.ndjson -o test_output -p test_ipld` + out = `./generate-ipld-car -i test_output/test.ndjson -o test_output` puts out result = JSON.parse(out) dataCid = result['DataCid'] @@ -86,7 +86,7 @@ def importToIpfs(path) system("ipfs get #{dataCid} -o test_ipld_out") # Compare test_ipld and test_ipld_out folder to make sure they are the same - expect(`diff -r test_ipld test_ipld_out`).to eq '' + expect(`diff -r test_ipld test_ipld_out/test_ipld`).to eq '' end end