Skip to content

Commit

Permalink
Rename toolcache directory instead of moving to tmp
Browse files Browse the repository at this point in the history
This further enhances time savings seen in actions#213, down from a few minutes to seconds.
  • Loading branch information
js6pak committed Jul 20, 2024
1 parent 6bd8b7f commit b4737b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions __tests__/clear-toolcache.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ $dotnetPaths = @{

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

0 comments on commit b4737b4

Please sign in to comment.