Browse Source

Refine NuGet package push script to initialize and log failed packages to a dedicated file, enhancing error tracking and management.

pull/25261/head
selmankoc 6 months ago
parent
commit
98144758f6
  1. 3
      nupkg/push-nightly-packages-myget.ps1

3
nupkg/push-nightly-packages-myget.ps1

@ -16,6 +16,8 @@ if (!$apikey)
$maxRetryCount = 3
$retryDelaysInSeconds = @(30, 60, 120)
$failedPackages = @()
$failedPackagesFilePath = Join-Path (Get-Location) "failed-packages.txt"
if (Test-Path $failedPackagesFilePath) { Remove-Item $failedPackagesFilePath -Force }
$packages = Get-ChildItem -Filter *.nupkg | Sort-Object Name
@ -61,5 +63,6 @@ if ($failedPackages.Count -gt 0)
{
$errorCount = $failedPackages.Count
Write-Host ("******* $errorCount error(s) occured *******") -ForegroundColor red
$failedPackages | Set-Content -Path $failedPackagesFilePath
exit 1
}
Loading…
Cancel
Save