From a3d47e556cc06347e059f4db4672c7a8dce29e8b Mon Sep 17 00:00:00 2001 From: Vladimir Safonkin Date: Wed, 3 Feb 2021 15:13:32 +0300 Subject: [PATCH] Debug --- __tests__/clear-toolcache.ps1 | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 1e332c7..1e702c5 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -1,4 +1,26 @@ Write-Host $args[0] -Write-Host $env:PATH +$os = $args[0] + +$linuxDotnetPaths = @("/usr/share/dotnet") +$macOSDotnetPaths = @("/Users/runner/.dotnet") +$windowsDotnetPaths = @("$env:LocalAppData\Microsoft\dotnet/*", "$env:ProgramFiles\dotnet/*") + +$pathsToClear = @() + +if ($os == "linux") { + $pathsToClear = $linuxDotnetPaths +} elseif ($os == "macOS") { + $pathsToClear = $macOSDotnetPaths +} elseif ($os == "windows") { + $pathsToClear = $windowsDotnetPaths +} + +foreach ($path in $pathsToClear) { + if (Test-Path $path) { + Write-Host "Clear $path" + Remove-Item $path -Recurse -Force + } +} + dotnet --info \ No newline at end of file