From 60459a5b046c82c8a2061eb10024920370cf0bd4 Mon Sep 17 00:00:00 2001 From: Dmitry Shibanov Date: Sat, 27 Mar 2021 10:51:01 +0300 Subject: [PATCH] add replace from '+' to '-' (#3027) --- images/macos/provision/core/openjdk.sh | 2 +- images/macos/software-report/SoftwareReport.Java.psm1 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/images/macos/provision/core/openjdk.sh b/images/macos/provision/core/openjdk.sh index eb4034b2..72504f2f 100644 --- a/images/macos/provision/core/openjdk.sh +++ b/images/macos/provision/core/openjdk.sh @@ -21,7 +21,7 @@ installJavaFromAdoptOpenJDK() { 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")') 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 javaToolcacheVersionArchPath=$javaToolcacheVersionPath/x64 diff --git a/images/macos/software-report/SoftwareReport.Java.psm1 b/images/macos/software-report/SoftwareReport.Java.psm1 index 29dc61df..b0d73b79 100644 --- a/images/macos/software-report/SoftwareReport.Java.psm1 +++ b/images/macos/software-report/SoftwareReport.Java.psm1 @@ -10,10 +10,11 @@ function Get-JavaVersions { $javaPath = $_.Value # Take semver from the java path $version = $javaPath.split('/')[5] + $fullVersion = $version.Replace('-', '+') $defaultPostfix = ($javaPath -eq $defaultJavaPath) ? " (default)" : "" [PSCustomObject] @{ - "Version" = $version + $defaultPostfix + "Version" = $fullVersion + $defaultPostfix "Vendor" = "Adopt OpenJDK" "Environment Variable" = $_.Name }