Problem
A Chocolatey Package, which requires certain software located on the Chocolatey Gallery has been created by following the instructions on this website. If the nuspec file contains dependencies:
...</tags>
<dependencies>
<dependency id="dependentPackageA" version="1.0"/>
<dependency id="dependentPackageB" version="2.0"/>
</dependencies>
</metadata>...
and the command cinst packageName -source ""%cd%;http://chocolatey.org/api/v2/""
is executed to test the Chocolatey Package locally, the following error occurs:
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.
If the dependency snippet has been commented and cinst packageName -source %cd%
is executed the Chocolatey Package will be installed locally.
Providing the Chocolatey Package to the Chocolatey Gallery and subsequently install it by issuing cinst packageName
succeeds (package and dependencies are installed).
Question
How to test Chocolatey Package dependencies locally before publishing it to the Chocolatey Gallery?
Use apostrophe '
and double quotes "
on each side, like:
--source "'.;https://chocolatey.org/api/v2/'"
To shorten that a bit, in newer versions of Chocolatey you can try:
-s "'.;chocolatey'"
https://github.com/chocolatey/choco/wiki/CreatePackages#testing-your-package
Passing Arguments to Chocolatey
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With