From b6d99efb99160747a93761607c77e57fa1dd3d25 Mon Sep 17 00:00:00 2001 From: Sascha Mann Date: Tue, 11 Feb 2020 13:35:42 +0100 Subject: [PATCH] Simplify Validate-Julia.ps1 script --- .../win/scripts/Installers/Validate-Julia.ps1 | 36 ++++--------------- 1 file changed, 6 insertions(+), 30 deletions(-) diff --git a/images/win/scripts/Installers/Validate-Julia.ps1 b/images/win/scripts/Installers/Validate-Julia.ps1 index e3c8973c..fa4a26e1 100644 --- a/images/win/scripts/Installers/Validate-Julia.ps1 +++ b/images/win/scripts/Installers/Validate-Julia.ps1 @@ -14,36 +14,12 @@ else exit 1 } -# Add details of available versions in Markdown -$tmplMark = @" -#### {0} - -_Environment:_ -* {1}: root directory of the Julia {0} installation - -"@ - -$tmplMarkRoot = @" -#### {0} - -_Environment:_ -* PATH: contains the location of julia.exe version {0} -* {1}: root directory of the Julia {0} installation -"@ - +# Add description of the software to Markdown $SoftwareName = "Julia (x64)" -$Description = New-Object System.Text.StringBuilder -$juliaVersionsToInstall = $env:JULIA_VERSIONS.split(",") +$juliaVersion = $(julia --version) -match "\d+\.\d+\.\d+" -foreach($julia in $juliaVersionsToInstall) { - $juliaVersion = Get-JuliaVersion - if ($juliaVersion -eq $julia) { - if($julia -eq $env:JULIA_DEFAULT) { - $null = $Description.AppendLine(($tmplMarkRoot -f $juliaVersion)) - } else { - $null = $Description.AppendLine(($tmplMark -f $juliaVersion)) - } - } -} +$Description = @" +_Version:_ $juliaVersion
+"@ -Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString() +Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description