Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test dependencies of Chocolatey packages locally?

Tags:

chocolatey

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?

like image 493
030 Avatar asked Apr 27 '14 11:04

030


1 Answers

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

like image 90
ferventcoder Avatar answered Oct 01 '22 13:10

ferventcoder