Skip to content

Commit

Permalink
Merge pull request #213 from al-cheb/al-cheb/move-dotnet-dir
Browse files Browse the repository at this point in the history
Move toolcache folder
  • Loading branch information
Vladimir Safonkin committed Jun 28, 2021
2 parents 9647326 + 5070486 commit 5306333
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions __tests__/clear-toolcache.ps1
@@ -1,13 +1,13 @@
$dotnetPaths = @{
Linux = @("/usr/share/dotnet")
macOS = @("$env:HOME/.dotnet")
Windows = @("$env:ProgramFiles\dotnet/*",
"$env:LocalAppData\Microsoft\dotnet/*")
Linux = "/usr/share/dotnet"
macOS = "$env:HOME/.dotnet"
Windows = "$env:ProgramFiles\dotnet", "$env:LocalAppData\Microsoft\dotnet"
}

foreach ($path in $dotnetPaths[$args[0]]) {
if (Test-Path $path) {
Write-Host "Clear $path path"
Remove-Item $path -Recurse -Force
foreach ($srcPath in $dotnetPaths[$args[0]]) {
if (Test-Path $srcPath) {
Write-Host "Move $srcPath path"
$dstPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
Move-Item -Path $srcPath -Destination $dstPath
}
}

0 comments on commit 5306333

Please sign in to comment.