diff --git a/build/jenkins/zip b/build/jenkins/zip index b3c27a5..2488631 100644 --- a/build/jenkins/zip +++ b/build/jenkins/zip @@ -128,14 +128,28 @@ pipeline { exit 1 } - # Output the final zip filename - Write-Output $zipFilename + # This is the critical fix - we need to make sure this is the last thing output + # And ensure it's on its own line with no other text + Write-Host "ZIPFILENAME=$zipFilename" exit 0 ''' - // Trim the output and set the environment variable - env.CREATED_ZIP_FILENAME = zipFilenameOutput.trim() - echo "Zip filename: ${env.CREATED_ZIP_FILENAME}" + // Extract the zip filename from the PowerShell output by looking for "ZIPFILENAME=" prefix + def outputLines = zipFilenameOutput.split('\n') + def zipFilename = null + for (line in outputLines) { + if (line.trim().startsWith("ZIPFILENAME=")) { + zipFilename = line.trim() - "ZIPFILENAME=" + break + } + } + + if (zipFilename) { + env.CREATED_ZIP_FILENAME = zipFilename.trim() + echo "Found zip filename: ${env.CREATED_ZIP_FILENAME}" + } else { + error "Failed to extract zip filename from PowerShell output. Check PowerShell script." + } } } }