diff --git a/cmd-car-split.go b/cmd-car-split.go index 22fa0de8..da539bba 100644 --- a/cmd-car-split.go +++ b/cmd-car-split.go @@ -213,7 +213,7 @@ func newCmd_SplitCar() *cli.Command { return fmt.Errorf("failed to close file: %w", err) } - err = carv2.ReplaceRootsInFile(cf.name, []cid.Cid{cf.payloadCid}) + err = carv2.ReplaceRootsInFile(filepath.Join(outputDir, cf.name), []cid.Cid{cf.payloadCid}) if err != nil { return fmt.Errorf("failed to replace root: %w", err) } @@ -378,7 +378,7 @@ func newCmd_SplitCar() *cli.Command { return fmt.Errorf("failed to close file: %w", err) } - err = carv2.ReplaceRootsInFile(cf.name, []cid.Cid{cf.payloadCid}) + err = carv2.ReplaceRootsInFile(filepath.Join(outputDir, cf.name), []cid.Cid{cf.payloadCid}) if err != nil { return fmt.Errorf("failed to replace root: %w", err) }