File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -1223,6 +1223,7 @@ function Get-Dependencies {
12231223 param
12241224 (
12251225 [string ]$SourceName ,
1226+ [string ]$BinaryCache ,
12261227 [string ]$DestinationName
12271228 )
12281229 $Source = Join-Path - Path $BinaryCache - ChildPath $SourceName
@@ -1369,12 +1370,14 @@ function Get-Dependencies {
13691370
13701371 if ($EnableCaching ) {
13711372 $SCCache = Get-SCCache
1372- $FileExtension = [System.IO.Path ]::GetExtension($SCCache.URL )
1373- DownloadAndVerify $SCCache.URL " $BinaryCache \sccache-$SCCacheVersion .$FileExtension " $SCCache.SHA256
1374- if ($FileExtension -eq " tar.gz" ) {
1375- Expand-TapeArchive sccache- $SCCacheVersion .$FileExtension $BinaryCache sccache- $SCCacheVersion
1373+ $FileExtension = if ($SCCache.URL -match ' /[^/]+(\..+)$' ) { $Matches [1 ] } else {
1374+ throw " Invalid sccache URL"
1375+ }
1376+ DownloadAndVerify $SCCache.URL " $BinaryCache \sccache-$SCCacheVersion$FileExtension " $SCCache.SHA256
1377+ if ($FileExtension -eq " .tar.gz" ) {
1378+ Expand-TapeArchive " sccache-$SCCacheVersion$FileExtension " $BinaryCache " sccache-$SCCacheVersion "
13761379 } else {
1377- Expand-ZipFile sccache- $SCCacheVersion . $FileExtension $BinaryCache sccache- $SCCacheVersion
1380+ Expand-ZipFile " sccache-$SCCacheVersion$FileExtension " $BinaryCache " sccache-$SCCacheVersion "
13781381 }
13791382 Write-Success " sccache $SCCacheVersion "
13801383 }
You can’t perform that action at this time.
0 commit comments