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.

2

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

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.
@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
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.
@GaryEwanPark ..\common did not work, but ..\..\..\common works as from the _output directory the common folder can be found now. Thank you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.