recursive files copy?

21 views
Skip to first unread message

bdaniel7

unread,
Nov 14, 2011, 2:43:47 PM11/14/11
to phantom-discuss
Hi,

I need to copy the files for a web project, aspx, ascx which are
located in different folders inside the project.

The structure looks like this:

/bin
/content/css/*.css
/content/js/*.js
/admin/*.aspx
/reports/*.aspx
/controls/*.ascx
/web.config

This line however does not copy the files recursively, but only the
files in the root of the project, like web.config.

with FileList("../Hop.Admin"):
.Include("*.
{aspx,ascx,config,master,asax,htm,html,css,js,jpg,png,gif}")
.ForEach def(file):
file.CopyToDirectory("../deploy/${configuration}/${label}")

Strangely enough, if I use FileList("../Hop.Admin/*") the structure of
folders is created, however, the first letter of each folder name is
missing, like /ontent, /dmin.

How should I do it?

Thanks,
Daniel

Jeremy Skinner

unread,
Nov 14, 2011, 2:47:45 PM11/14/11
to phantom...@googlegroups.com
Hi

To recursively copy files you need to use **, for example the pattern **/*.cs would recursively copy all .cs files no matter how deep they are.

Jeremy 
Reply all
Reply to author
Forward
0 new messages