Merge pull request #213 from al-cheb/al-cheb/move-dotnet-dir

Move toolcache folder
This commit is contained in:
Vladimir Safonkin 2021-06-28 12:09:16 +03:00 committed by GitHub
commit 5306333434
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,13 @@
$dotnetPaths = @{ $dotnetPaths = @{
Linux = @("/usr/share/dotnet") Linux = "/usr/share/dotnet"
macOS = @("$env:HOME/.dotnet") macOS = "$env:HOME/.dotnet"
Windows = @("$env:ProgramFiles\dotnet/*", Windows = "$env:ProgramFiles\dotnet", "$env:LocalAppData\Microsoft\dotnet"
"$env:LocalAppData\Microsoft\dotnet/*")
} }
foreach ($path in $dotnetPaths[$args[0]]) { foreach ($srcPath in $dotnetPaths[$args[0]]) {
if (Test-Path $path) { if (Test-Path $srcPath) {
Write-Host "Clear $path path" Write-Host "Move $srcPath path"
Remove-Item $path -Recurse -Force $dstPath = Join-Path ([IO.Path]::GetTempPath()) ([IO.Path]::GetRandomFileName())
Move-Item -Path $srcPath -Destination $dstPath
} }
} }