tags:

views:

255

answers:

3

I'm writing a rakefile using Albacore for my .NET stuff, and I'm trying to figure out the easiest way to copy a project to another directory (artifacts) while excluding the .svn directories in its subdirectories.

Suggestions? I'm running into a wall here.

+1  A: 

Use XCOPY /EXCLUDE. For example

XCOPY <src> <dest> /EXCLUDE:svn.txt

svn.txt contains \.svn

Byron Whitlock
I ended up using this solution, but it feels kinda dirty. I wish there was a cleaner way. I may have to just man-up and whip out some ruby-fu.
James Thigpen
+1  A: 

Wouldn't be svn export to the other directory an option?

Filburt
A: 

I know i'm late the game, here... but it's pretty simple with ruby:

FileUtils.cp(FileList["*/"].exclude(".svn"), "some/destination/folder")

the FileUtils class mimics a bash shell's file utilities, so "mv" is "move" and "cp" is "copy".

The FileList object is built into Rake and is an easy way to create an array of files based on globs and other search parameters. the .exclude method of the FileList will exclude the files that match the pattern stated.

Derick Bailey