Search code examples
chocolateynuspec

How to avoid code duplication in nuspec?


A nuspec file contains multiple paragraphs that are required by other nuspec files, e.g.:

### Optional installation commands:

Issue `-packageparameters '"/InstallLocation=C:\Path\to\installationdirectory"'` to overwrite the default installation directory, e.g. `choco install eclipse -packageparameters '"/InstallLocation=C:\temp"'` extracts the package in `C:\temp`.

### Bugs and Features:

Create an issue or comment to an existing one - https://github.com/030/chocolateyautomatic/issues

Every time this paragraph changes it needs to be copied to the other nuspec files.


Solution

  • That's not really code duplication. You have multiple packages where you are doing the same thing, but each package is its own different thing.