Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to exclude a subdirectory and contents from a nuget package

So I've a website that I'm trying to package for Octopus Deploy.

I've the following folder structure:

Web | Views | WantThis Dontwantthis WantThis1 WantThis2 ... (lots more) Scripts

I'm trying to exclude the "Dontwantthisfolder"

So my nuspec looks like this:

... <file src="..\Web\Views\**\*.*" exclude="**\Dontwantthis\**" target="web\Views" /> ...

It's not working though, I still get the "Dontwantthis" folder.

Anyone know how I can achieve this?

like image 265
jaywayco Avatar asked Oct 15 '25 16:10

jaywayco


1 Answers

You're quite close. Try this:

<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 file system structure:

Root
   |
   Source
        |
        Test.nuspec
   Web
     |
     Scripts
           |
           Script.js
     Views
         |
         DontWantThis
                    |
                    Bad.cshml
         WantThis
                |
                Good.cshtml
         ...
like image 168
Mike Bailey Avatar answered Oct 18 '25 06:10

Mike Bailey



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!