030
030

Reputation: 11719

How to add additional files to a package using NuGet?

Attempt

Nuspec

<files>
  <file src="https://raw.githubusercontent.com/030/chocolateyautomatic/master/common/Uninstall-ChocolateyZipPackage030.ps1" target="tools" />
</files>

Result

File is not added to tools directory


Running cpack indicates the following:

Calling 'C:\ProgramData\Chocolatey\chocolateyinstall\nuget.exe pack  -NoPackageAnalysis
Attempting to build package from 'eclipse.nuspec'.
The given path's format is not supported.

Attempt two

  <files>
    <file src="path\to\chocolateyautomatic\common\Uninstall-ChocolateyZipPackage030.ps1" target="tools\Uninstall-ChocolateyZipPackage030.ps1" />
  </files>

Result Two

The The given path's format is not supported. issue has been disappeared, but the Uninstall-ChocolateyZipPackage030.ps1 file is not added to the tools directory.

Upvotes: 0

Views: 1109

Answers (1)

030
030

Reputation: 11719

  <files>
    <file src="..\..\..\common\Uninstall-ChocolateyZipPackage030.ps1" target="tools\Uninstall-ChocolateyZipPackage030.ps1" />
    <file src="tools\*" target="tools" />
  </files>

adds all the files to the nupkg file.

Upvotes: 2

Related Questions