Reputation: 869
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.
Upvotes: 2
Views: 1552
Reputation: 72868
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.
Upvotes: 6
Reputation: 53861
Use XCOPY /EXCLUDE
.
For example
XCOPY <src> <dest> /EXCLUDE:svn.txt
svn.txt
contains \.svn
Upvotes: 2