Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2108] do not download the same file again #2212

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the $fullPkgPath always going to be different for each version?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

image

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: add some cleanup logic to the script...

$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