From 69cb9f981ca9879007031150e8a9a01361a458a5 Mon Sep 17 00:00:00 2001 From: ScriptSage001 Date: Tue, 13 May 2025 00:04:33 +0530 Subject: [PATCH] Fixed the ps script --- scripts/build-pack-push.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/build-pack-push.ps1 b/scripts/build-pack-push.ps1 index bfc4e06..c7ac40f 100644 --- a/scripts/build-pack-push.ps1 +++ b/scripts/build-pack-push.ps1 @@ -3,12 +3,14 @@ param ( [string]$Version ) +$projectDir = Split-Path -Path $ProjectPath -Parent + Write-Host "🔧 Building project at $ProjectPath with version $Version" dotnet build "$ProjectPath" -c Release dotnet pack "$ProjectPath" -c Release -p:PackageVersion=$Version -$nupkg = Get-ChildItem "$ProjectPath/bin/Release" -Filter *.nupkg | Select-Object -First 1 +$nupkg = Get-ChildItem "$projectDir/bin/Release" -Filter *.nupkg | Sort-Object LastWriteTime -Descending | Select-Object -First 1 if ($nupkg) { Write-Host "📦 Found package: $($nupkg.FullName)" dotnet nuget push $nupkg.FullName -k $env:NUGET_API_KEY -s https://api.nuget.org/v3/index.json --skip-duplicate