大重构
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
param(
|
||||
[string]$Version = "",
|
||||
[switch]$Force
|
||||
)
|
||||
$ErrorActionPreference = "Stop"
|
||||
$arguments = @("install", "--id", "LLVM.LLVM", "--exact", "--silent", "--accept-package-agreements", "--accept-source-agreements", "--disable-interactivity")
|
||||
if ($Version) {
|
||||
$arguments += @("--version", $Version)
|
||||
}
|
||||
if ($Force) {
|
||||
$arguments += "--force"
|
||||
}
|
||||
& winget @arguments
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
$clangTidy = "C:\Program Files\LLVM\bin\clang-tidy.exe"
|
||||
if (!(Test-Path -LiteralPath $clangTidy)) {
|
||||
throw "clang-tidy was not installed at $clangTidy"
|
||||
}
|
||||
& $clangTidy --version
|
||||
Reference in New Issue
Block a user