Nuget包并在同一批处理脚本中推送 [英] Nuget pack AND push within same batch script
问题描述
我花了很多时间编写批处理脚本来打包并将生成的.nupkg
文件推送到我的私有nuget提要中.我可以很好地调用pack
,但是我不知道如何从结果输出中解析nupkg的名称以便执行push
.不幸的是,版本号一直在自动递增,因此我不能仅假设结果文件将被命名为什么.
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,我正在使用myget.org进行我的私人托管,但这很容易应用于任何主机(包括nuget.org).
FWIW, I'm using myget.org for my private hosting, but this is could easily be applied to any host (including nuget.org).
推荐答案
nuget push支持通配符,因此您可以执行以下操作:
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
这篇关于Nuget包并在同一批处理脚本中推送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!