Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nuget pack AND push within same batch script

I'm having a heck of time writing a batch script to both pack and push the resulting .nupkg file up to my private nuget feed. I can call pack just fine, but I don't know how to parse the name of the nupkg out of the resulting output in order to do the push. Unfortunately, the version number auto-increments all the time, so I can't just make an assumption of what the resulting file would be named.

FWIW, I'm using myget.org for my private hosting, but this is could easily be applied to any host (including nuget.org).

like image 814
viggity Avatar asked Mar 10 '14 19:03

viggity


1 Answers

nuget push supports wildcards, so you could do something like this:

REM delete existing nuget packages
del *.nupkg

nuget pack MyProject.csproj

nuget push *.nupkg
like image 74
Taylor Lafrinere Avatar answered Sep 30 '22 18:09

Taylor Lafrinere