Skip to content

Commit

Permalink
[microsoft#2108] do not download the same file again
Browse files Browse the repository at this point in the history
  • Loading branch information
christophvw committed Oct 25, 2024
1 parent a6be221 commit 39f5a23
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions Admin/Update-Engines.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -241,22 +241,27 @@ foreach ($p in $Platforms) {
$fullPkgUrl = $engineUrl + $manifest.ManifestFile.Package.version + "/" + $manifest.ManifestFile.Package.FullPackage.name
$fullPkgPath = ($fullPkgDir + $manifest.ManifestFile.Package.FullPackage.name)

$wc.DownloadFile($fullPkgUrl, $fullPkgPath)
if (((Test-Path $fullPkgPath) -ne $true) -or ((Get-Item $fullPkgPath).Length -ne $manifest.ManifestFile.Package.FullPackage.Size)) {
$wc.DownloadFile($fullPkgUrl, $fullPkgPath)

# Detect if there are any subdirectories
# needed for this engine
$subDirCount = $manifest.ManifestFile.Package.Files.Dir.Count
# Detect if there are any subdirectories
# needed for this engine
$subDirCount = $manifest.ManifestFile.Package.Files.Dir.Count

for ($i=0; $i -lt $subDirCount; $i++) {
CreatePath ($fullPkgDir + $manifest.ManifestFile.Package.Files.Dir[$i].name)
}
for ($i=0; $i -lt $subDirCount; $i++) {
CreatePath ($fullPkgDir + $manifest.ManifestFile.Package.Files.Dir[$i].name)
}

ExtractCab $fullPkgPath $fullPkgDir
ExtractCab $fullPkgPath $fullPkgDir

# Copy the downloaded manifest to the package directory
Copy-Item $manifestPath -Destination $fullPkgDir
# Copy the downloaded manifest to the package directory
Copy-Item $manifestPath -Destination $fullPkgDir

Write-Host "Download Complete: " $engine.Name
Write-Host "Download Complete: " $engine.Name
}
else {
Write-Host "Engine already up to date: " $engine.Name
}
}
}
}
Expand Down

0 comments on commit 39f5a23

Please sign in to comment.