Simplify Validate-Julia.ps1 script

This commit is contained in:
Sascha Mann
2020-02-11 13:35:42 +01:00
parent dd2c76c8a3
commit b6d99efb99

View File

@@ -14,36 +14,12 @@ else
exit 1 exit 1
} }
# Add details of available versions in Markdown # Add description of the software to 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
"@
$SoftwareName = "Julia (x64)" $SoftwareName = "Julia (x64)"
$Description = New-Object System.Text.StringBuilder $juliaVersion = $(julia --version) -match "\d+\.\d+\.\d+"
$juliaVersionsToInstall = $env:JULIA_VERSIONS.split(",")
foreach($julia in $juliaVersionsToInstall) { $Description = @"
$juliaVersion = Get-JuliaVersion _Version:_ $juliaVersion<br/>
if ($juliaVersion -eq $julia) { "@
if($julia -eq $env:JULIA_DEFAULT) {
$null = $Description.AppendLine(($tmplMarkRoot -f $juliaVersion))
} else {
$null = $Description.AppendLine(($tmplMark -f $juliaVersion))
}
}
}
Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description.ToString() Add-SoftwareDetailsToMarkdown -SoftwareName $SoftwareName -DescriptionMarkdown $Description