Nuget包并在同一批处理脚本中推送 [英] Nuget pack AND push within same batch script

查看:102
本文介绍了Nuget包并在同一批处理脚本中推送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了很多时间编写批处理脚本来打包并将生成的.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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆