Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding an entire folder / contents from 'Copy Files' step in TFS 2017 build definition

I'm struggling with getting a TFS build definition to exclude an entire folder and all of its contents from a "Copy Files" step, as shown here: enter image description here

Here's essentially what I'm trying to do:

Copy everything except a folder named 'node_modules' from:

\\Test\Source

to:

\\Test\Destination

The path of the folder I need to exclude is:

\\Test\Source\AppsJs\v3\node_modules

I can easily exclude files using the same pattern as I have above, but I can't figure out how to exclude the entire folder.

I've also seen some suggesting using -: as well, but I haven't been able to get that to work.

I've tried looking at the "Copy Files" documentation here, and read some more here and here, but I'm still just missing something.

Any help is appreciated!

like image 485
Shaun Z. Avatar asked Apr 07 '17 16:04

Shaun Z.


2 Answers

You should set the contents with two lines as:

**\**
!AppsJs\v3\node_modules\**
like image 55
Marina Liu Avatar answered Oct 16 '22 01:10

Marina Liu


For anyone looking for a solution in 2020, here is what I did:

**/*
!.git/**
!node_modules/**
like image 32
Tallal Kazmi Avatar answered Oct 15 '22 23:10

Tallal Kazmi