How to exclude subdirectory and content from nuget package
So I have a website that I am trying to package for Octopus Deploy.
I have the following folder structure:
Web
|
Views
|
WantThis
Dontwantthis
WantThis1
WantThis2
... (lots more)
Scripts
I'm trying to rule out "Dontwantthisfolder"
So my nuspec looks like this:
...
<file src="..\Web\Views\**\*.*" exclude="**\Dontwantthis\**" target="web\Views" />
...
It doesn't work, although I still get the "Dontwantthis" folder.
Does anyone know how I can achieve this?
+3
source to share
1 answer
You are very close. Try the following:
<files>
<file src="..\Web\Views\**\*.*" exclude="..\Web\Views\DontWantThis\*" target="Web\Views" />
</files>
I was able to get this to exclude DontWantThis
with the following filesystem structure:
Root
|
Source
|
Test.nuspec
Web
|
Scripts
|
Script.js
Views
|
DontWantThis
|
Bad.cshml
WantThis
|
Good.cshtml
...
+4
source to share