From 453db825a7eb1c4e4207aec858a85691ed97b985 Mon Sep 17 00:00:00 2001 From: Anjor Kanekar Date: Tue, 29 Oct 2024 08:42:20 +0000 Subject: [PATCH] fix output dir (#178) * fix output dir * other place --- cmd-car-split.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) }