Skip to content

Commit b4737b4

Browse files
committed
Rename toolcache directory instead of moving to tmp
This further enhances time savings seen in actions#213, down from a few minutes to seconds.
1 parent 6bd8b7f commit b4737b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

__tests__/clear-toolcache.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ $dotnetPaths = @{
66

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

0 commit comments

Comments
 (0)