0

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.

030
  • 10,842
  • 12
  • 78
  • 123

1 Answers1

2
  <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.

030
  • 10,842
  • 12
  • 78
  • 123
  • you probably don't want to be using a hard coded path to the file. You should instead use a relative path to the file. That way, should you change the checkout directory of the repository, the file inclusions will still work. – Gary Ewan Park Dec 02 '14 at 09:57
  • @GaryEwanPark Agreed but how could this be implemented? The common folder does not reside in eclipse folder such as the tools directory. I am checking [this documentation](http://docs.nuget.org/docs/reference/nuspec-reference) – 030 Dec 02 '14 at 10:10
  • 1
    I would have thought you should have been able to do something similar to src="..\..\common\..." i.e. navigate up a folder relative to where the nuspec file is, and then navigate to the required folder path. – Gary Ewan Park Dec 02 '14 at 10:59
  • 1
    @GaryEwanPark `..\common` did not work, but `..\..\..\common` works as from the `_output` directory the common folder can be found now. Thank you. – 030 Dec 02 '14 at 12:33