Skip to content

Commit 0b208dc

Browse files
committed
[go] Avoid duplicate bundler license downloads
1 parent 5b3a03e commit 0b208dc

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

‎go/cmd/bundler/main.go‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ func main() {
115115
os.Exit(1)
116116
}
117117
}
118+
if err := downloadCLILicense(version, outputPath); err != nil {
119+
fmt.Fprintf(os.Stderr, "Error: failed to download CLI license: %v\n", err)
120+
os.Exit(1)
121+
}
118122

119123
// Generate the Go file with embed directive
120124
if err := generateGoFile(
@@ -321,9 +325,6 @@ func buildBundle(info platformInfo, cliVersion, outputPath, goos string) (bundle
321325
if err != nil {
322326
return bundleArtifacts{}, fmt.Errorf("failed to hash existing output: %w", err)
323327
}
324-
if err := downloadCLILicense(cliVersion, outputPath); err != nil {
325-
return bundleArtifacts{}, fmt.Errorf("failed to download CLI license: %w", err)
326-
}
327328
runtimeHash, err := sha256FileFromCompressed(runtimeArtifactPath)
328329
if err != nil {
329330
return bundleArtifacts{}, fmt.Errorf("failed to hash existing runtime.node: %w", err)
@@ -364,9 +365,6 @@ func buildBundle(info platformInfo, cliVersion, outputPath, goos string) (bundle
364365
if err := compressZstdFile(binaryPath, outputPath); err != nil {
365366
return bundleArtifacts{}, fmt.Errorf("failed to write output binary: %w", err)
366367
}
367-
if err := downloadCLILicense(cliVersion, outputPath); err != nil {
368-
return bundleArtifacts{}, fmt.Errorf("failed to download CLI license: %w", err)
369-
}
370368

371369
rawLibPath := filepath.Join(tempDir, "runtime.node")
372370
if err := extractFileFromTarball(

0 commit comments

Comments
 (0)