From d1a18f186f465878ccc479873e0ed44feb66471a Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Wed, 11 Oct 2023 16:29:49 +0200 Subject: [PATCH] fix: output `provided.al2` also when zipGo is disabled (#1609) * fix: also emit `provided.al2` when zipGo is disabled * fix: emit generator and runtimeVersion in zipGo path --------- Co-authored-by: Lukas Holzer --- src/runtimes/go/index.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/runtimes/go/index.ts b/src/runtimes/go/index.ts index b9a85e008..432d0627b 100644 --- a/src/runtimes/go/index.ts +++ b/src/runtimes/go/index.ts @@ -134,6 +134,13 @@ const zipFunction: ZipFunction = async function ({ } } + const result = { + config, + displayName: config?.name, + generator: config?.generator || getInternalValue(isInternal), + runtimeVersion: featureFlags.zisi_golang_use_al2 ? 'provided.al2' : undefined, + } + // If `zipGo` is enabled, we create a zip archive with the Go binary and the // toolchain file. if (config.zipGo) { @@ -147,10 +154,9 @@ const zipFunction: ZipFunction = async function ({ await zipBinary({ ...zipOptions, srcPath: binary.path, stat: binary.stat }) return { - config, + ...result, path: zipPath, entryFilename: zipOptions.filename, - runtimeVersion: featureFlags.zisi_golang_use_al2 ? 'provided.al2' : undefined, } } @@ -162,11 +168,9 @@ const zipFunction: ZipFunction = async function ({ } return { - config, + ...result, path: destPath, entryFilename: '', - displayName: config?.name, - generator: config?.generator || getInternalValue(isInternal), } }