From 98144758f697e74e3584a5159d2382ecf294e7ca Mon Sep 17 00:00:00 2001 From: selmankoc Date: Tue, 14 Apr 2026 15:53:49 +0300 Subject: [PATCH] Refine NuGet package push script to initialize and log failed packages to a dedicated file, enhancing error tracking and management. --- nupkg/push-nightly-packages-myget.ps1 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nupkg/push-nightly-packages-myget.ps1 b/nupkg/push-nightly-packages-myget.ps1 index 3127d21f0c..76febf2e94 100644 --- a/nupkg/push-nightly-packages-myget.ps1 +++ b/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 } \ No newline at end of file