Skip to content

Commit 30c9d43

Browse files
authored
Merge pull request #899 from EUCPilots/zulu
Improve ImageType detection in Get-AzulZulu.ps1
2 parents f89289e + f8b0829 commit 30c9d43

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change log
22

3+
## VERSION
4+
5+
* 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)
6+
37
## 2511.2826.0
48

59
* Fix `JRE` or `JDK` string match in `Get-AzulZulu`

Evergreen/Shared/Get-AzulZulu.ps1

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,24 @@ function Get-AzulZulu {
4949

5050
Write-Verbose -Message "$($MyInvocation.MyCommand): Filter for latest releases."
5151
foreach ($Release in ($Releases | Where-Object { ($_.$DISTRO_VERSION -join ".") -eq ($Version.$DISTRO_VERSION -join ".") })) {
52+
53+
# Match the download URL to determine the image type
54+
$ImageType = if ($Release.$DOWNLOAD_URL -match "(fx-jre)(?=\d)") {
55+
"JREFX"
56+
} elseif ($Release.$DOWNLOAD_URL -match "(fx-jdk)(?=\d)") {
57+
"JDKFX"
58+
} elseif ($Release.$DOWNLOAD_URL -match "(jre)(?=\d)") {
59+
"JRE"
60+
} elseif ($Release.$DOWNLOAD_URL -match "(jdk)(?=\d)") {
61+
"JDK"
62+
} else {
63+
"Unknown"
64+
}
65+
5266
$PSObject = [PSCustomObject]@{
5367
Version = $Release.$DISTRO_VERSION -join "."
5468
JavaVersion = "$($Release.java_version -join ".")$(if ($null -ne $Release.openjdk_build_number) { "+$($Release.openjdk_build_number)" })"
55-
ImageType = if ($Release.$DOWNLOAD_URL -match "(jre)(?=\d)") { "JRE" } else { "JDK" }
69+
ImageType = $ImageType
5670
Architecture = Get-Architecture -String $Release.$DOWNLOAD_URL
5771
Type = Get-FileType -File $Release.$DOWNLOAD_URL
5872
URI = $Release.$DOWNLOAD_URL

0 commit comments

Comments
 (0)