gpt4 book ai didi

chocolatey - 如何在本地测试 Chocolatey 包的依赖关系?

转载 作者:行者123 更新时间:2023-12-04 04:05:20 27 4
gpt4 key购买 nike

问题

Chocolatey 包,它需要位于 Chocolatey Gallery 上的某些软件已按照 this 上的说明创建网站。
如果 nuspec 文件包含依赖项:

...</tags>
<dependencies>
<dependency id="dependentPackageA" version="1.0"/>
<dependency id="dependentPackageB" version="2.0"/>
</dependencies>
</metadata>...

和命令 cinst packageName -source ""%cd%;http://chocolatey.org/api/v2/""执行本地测试Chocolatey Package,出现如下错误:
The term 'http://chocolatey.org/api/v2/' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.

如果依赖片段已被注释并且 cinst packageName -source %cd%执行后,Chocolatey 包将安装在本地。

Chocolatey Gallery 提供巧克力包装然后通过发出 cinst packageName 安装它成功(安装包和依赖项)。

问题

如何在将其发布到 Chocolatey Gallery 之前在本地测试 Chocolatey 包依赖项?

最佳答案

使用撇号 '和双引号 "在每一边,比如:

--source "'.;https://chocolatey.org/api/v2/'"

为了缩短一点,在新版本的 Chocolatey 中,您可以尝试:
-s "'.;chocolatey'"

https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package

Passing Arguments to Chocolatey

关于chocolatey - 如何在本地测试 Chocolatey 包的依赖关系?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23322746/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com