mirror of
https://github.com/actions/setup-dotnet.git
synced 2024-11-26 13:23:05 +07:00
24 lines
594 B
PowerShell
24 lines
594 B
PowerShell
$os = $args[0]
|
|
|
|
$linuxDotnetPaths = @("/usr/share/dotnet")
|
|
$macOSDotnetPaths = @("$env:HOME/.dotnet")
|
|
$windowsDotnetPaths = @("$env:ProgramFiles\dotnet/*",
|
|
"$env:LocalAppData\Microsoft\dotnet/*")
|
|
|
|
$pathsToClear = @()
|
|
|
|
if ($os -eq "Linux") {
|
|
$pathsToClear = $linuxDotnetPaths
|
|
} elseif ($os -eq "macOS") {
|
|
$pathsToClear = $macOSDotnetPaths
|
|
} elseif ($os -eq "Windows") {
|
|
$pathsToClear = $windowsDotnetPaths
|
|
}
|
|
|
|
foreach ($path in $pathsToClear) {
|
|
if (Test-Path $path) {
|
|
Write-Host "Clear $path path"
|
|
Remove-Item $path -Recurse -Force
|
|
}
|
|
}
|