Skip to content

Commit d5e1ae3

Browse files
committed
fix: fix type errors
1 parent ef33c30 commit d5e1ae3

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

pkg/cmd/build.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,7 @@ func pullBuildOutputs(ctx context.Context, client stainlessv0.Client, res stainl
443443
au.BrightCyan("✱"), i+1, len(targets), au.Bold(target), au.Cyan(targetDir))
444444

445445
// Get the output details
446-
outputRes, err := client.BuildTargetOutputs.Get(
446+
outputRes, err := client.Builds.TargetOutputs.Get(
447447
ctx,
448448
stainlessv0.BuildTargetOutputGetParams{
449449
BuildID: res.ID,
@@ -459,7 +459,7 @@ func pullBuildOutputs(ctx context.Context, client stainlessv0.Client, res stainl
459459
}
460460

461461
// Handle based on output type
462-
err = pullOutput(outputRes.Output, outputRes.URL, outputRes.Ref, targetDir, target)
462+
err = pullOutput(outputRes.Output, outputRes.URL, outputRes.Ref, targetDir)
463463
if err != nil {
464464
fmt.Fprintf(os.Stderr, "%s Failed to pull %s: %v\n",
465465
au.BrightRed("✱"), target, err)
@@ -478,7 +478,7 @@ func pullBuildOutputs(ctx context.Context, client stainlessv0.Client, res stainl
478478
}
479479

480480
// pullOutput handles downloading or cloning a build target output
481-
func pullOutput(output, url, ref, targetDir, target string) error {
481+
func pullOutput(output, url, ref, targetDir string) error {
482482
// Remove existing directory if it exists
483483
if _, err := os.Stat(targetDir); err == nil {
484484
fmt.Fprintf(os.Stderr, " %s Removing existing directory %s\n", au.BrightBlack("•"), targetDir)

pkg/cmd/buildtargetoutput.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,12 @@ func handleBuildsTargetOutputsRetrieve(ctx context.Context, cmd *cli.Command) er
6767
fmt.Printf("%s\n", colorizeJSON(res.RawJSON(), os.Stdout))
6868

6969
if cmd.Bool("pull") {
70-
targetDir := fmt.Sprintf("%s-%s", "tmp", "target")
71-
return pullOutput(res.Output, res.URL, res.Ref, targetDir, "target")
70+
build, err := cc.client.Builds.Get(ctx, cmd.String("build-id"))
71+
if err != nil {
72+
return err
73+
}
74+
targetDir := fmt.Sprintf("%s-%s", build.Project, cmd.String("target"))
75+
return pullOutput(res.Output, res.URL, res.Ref, targetDir)
7276
}
7377
return nil
7478
}

0 commit comments

Comments
 (0)