Files
build_infra/cloc_tokei/Install.ps1
T
2026-07-28 17:55:29 +08:00

18 lines
581 B
PowerShell

param(
[switch]$Force
)
$ErrorActionPreference = "Stop"
foreach ($package in @("XAMPPRocky.Tokei", "AlDanial.Cloc")) {
$arguments = @("install", "--id", $package, "--exact", "--silent", "--accept-package-agreements", "--accept-source-agreements", "--disable-interactivity")
if ($Force) {
$arguments += "--force"
}
& winget @arguments
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
}
$linkDir = Join-Path $env:LOCALAPPDATA "Microsoft\WinGet\Links"
& (Join-Path $linkDir "tokei.exe") --version
& (Join-Path $linkDir "cloc.exe") --version