From b4737b42ef4939bca196a752410e007bbcda3ee6 Mon Sep 17 00:00:00 2001 From: js6pak Date: Sun, 21 Jul 2024 00:41:11 +0200 Subject: [PATCH] Rename toolcache directory instead of moving to tmp This further enhances time savings seen in #213, down from a few minutes to seconds. --- __tests__/clear-toolcache.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/__tests__/clear-toolcache.ps1 b/__tests__/clear-toolcache.ps1 index 5589ec1..a8bd902 100644 --- a/__tests__/clear-toolcache.ps1 +++ b/__tests__/clear-toolcache.ps1 @@ -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 } } \ No newline at end of file