mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
add replace from '+' to '-' (#3027)
This commit is contained in:
@@ -21,7 +21,7 @@ installJavaFromAdoptOpenJDK() {
|
|||||||
assetUrl=$(curl -s "https://api.adoptopenjdk.net/v3/assets/latest/${JAVA_VERSION}/hotspot")
|
assetUrl=$(curl -s "https://api.adoptopenjdk.net/v3/assets/latest/${JAVA_VERSION}/hotspot")
|
||||||
asset=$(echo $assetUrl | jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="x64")')
|
asset=$(echo $assetUrl | jq -r '.[] | select(.binary.os=="mac" and .binary.image_type=="jdk" and .binary.architecture=="x64")')
|
||||||
archivePath=$(echo $asset | jq -r '.binary.package.link')
|
archivePath=$(echo $asset | jq -r '.binary.package.link')
|
||||||
fullVersion=$(echo $asset | jq -r '.version.semver')
|
fullVersion=$(echo $asset | jq -r '.version.semver' | tr '+' '-')
|
||||||
|
|
||||||
javaToolcacheVersionPath=$JAVA_TOOLCACHE_PATH/$fullVersion
|
javaToolcacheVersionPath=$JAVA_TOOLCACHE_PATH/$fullVersion
|
||||||
javaToolcacheVersionArchPath=$javaToolcacheVersionPath/x64
|
javaToolcacheVersionArchPath=$javaToolcacheVersionPath/x64
|
||||||
|
|||||||
@@ -10,10 +10,11 @@ function Get-JavaVersions {
|
|||||||
$javaPath = $_.Value
|
$javaPath = $_.Value
|
||||||
# Take semver from the java path
|
# Take semver from the java path
|
||||||
$version = $javaPath.split('/')[5]
|
$version = $javaPath.split('/')[5]
|
||||||
|
$fullVersion = $version.Replace('-', '+')
|
||||||
$defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : ""
|
$defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : ""
|
||||||
|
|
||||||
[PSCustomObject] @{
|
[PSCustomObject] @{
|
||||||
"Version" = $version + $defaultPostfix
|
"Version" = $fullVersion + $defaultPostfix
|
||||||
"Vendor" = "Adopt OpenJDK"
|
"Vendor" = "Adopt OpenJDK"
|
||||||
"Environment Variable" = $_.Name
|
"Environment Variable" = $_.Name
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user