Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Change log

## VERSION

* Update `Shared/Get-AzulZulu.ps1` - Refactor image type detection by extracting URL-matching logic into a dedicated variable. Add explicit handling for fx-jre -> JREFX and fx-jdk -> JDKFX, retain jre -> JRE and jdk -> JDK, and default to Unknown when no pattern matches. This expands supported image type distinctions. [https://github.com/EUCPilots/evergreen-apps/issues/87](https://github.com/EUCPilots/evergreen-apps/issues/87)

## 2511.2826.0

* Fix `JRE` or `JDK` string match in `Get-AzulZulu`
Expand Down
16 changes: 15 additions & 1 deletion Evergreen/Shared/Get-AzulZulu.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,24 @@ function Get-AzulZulu {

Write-Verbose -Message "$($MyInvocation.MyCommand): Filter for latest releases."
foreach ($Release in ($Releases | Where-Object { ($_.$DISTRO_VERSION -join ".") -eq ($Version.$DISTRO_VERSION -join ".") })) {

# Match the download URL to determine the image type
$ImageType = if ($Release.$DOWNLOAD_URL -match "(fx-jre)(?=\d)") {
"JREFX"
} elseif ($Release.$DOWNLOAD_URL -match "(fx-jdk)(?=\d)") {
"JDKFX"
} elseif ($Release.$DOWNLOAD_URL -match "(jre)(?=\d)") {
"JRE"
} elseif ($Release.$DOWNLOAD_URL -match "(jdk)(?=\d)") {
"JDK"
} else {
"Unknown"
}

$PSObject = [PSCustomObject]@{
Version = $Release.$DISTRO_VERSION -join "."
JavaVersion = "$($Release.java_version -join ".")$(if ($null -ne $Release.openjdk_build_number) { "+$($Release.openjdk_build_number)" })"
ImageType = if ($Release.$DOWNLOAD_URL -match "(jre)(?=\d)") { "JRE" } else { "JDK" }
ImageType = $ImageType
Architecture = Get-Architecture -String $Release.$DOWNLOAD_URL
Type = Get-FileType -File $Release.$DOWNLOAD_URL
URI = $Release.$DOWNLOAD_URL
Expand Down