[macOS] Clarify clang versions (#2147)

* add clang versions

* changed default location to  get-command

* changed formatting

Co-authored-by: Leonid Lapshin <originalnoe-nazvanie@yandex.ru>
This commit is contained in:
Leonid Lapshin
2020-12-04 13:45:53 +03:00
committed by GitHub
parent a25022f6a7
commit d18c405175

View File

@@ -72,8 +72,12 @@ function Get-FortranVersion {
}
function Get-ClangLLVMVersion {
$clangLLVMVersion = Run-Command "$(brew --prefix llvm)/bin/clang --version" | Select-Object -First 1 | Take-Part -Part 2
"Clang/LLVM $clangLLVMVersion"
$locationsList = @("$((Get-Command clang).Source)", '$(brew --prefix llvm)/bin/clang')
$locationsList | Foreach-Object {
(Run-Command "${_} --version" | Out-String) -match "(?<version>\d+\.\d+\.\d+)" | Out-Null
$version = $Matches.version
"Clang/LLVM $version " + $(if(${_} -Match "brew") {"is available on ``${_}``"} else {"is default"})
}
}
function Get-NVMVersion {