Skip to content

Instantly share code, notes, and snippets.

View brase's full-sized avatar
🦄

Sebastian Brandt brase

🦄
  • SoftwareONE
  • Leipzig
  • 04:58 (UTC +02:00)
  • X @brase
View GitHub Profile
@brase
brase / recursive_copy.rb
Created July 29, 2011 06:26 — forked from mxriverlynn/recursive_copy.rb
copy a folder structure from a source, to a dest, preserving relative paths
#recursive copy for build artifacts
def recursive_copy(source_folder, dest_folder)
wanted_extensions = [".dll",".pdb",".vsmdi",".config"]
FileList["#{source_folder}/**/*"].each do |file|
next if File.directory?(file) || !wanted_extensions.include?(File.extname(file))
# get relative file path... source/folder/file.ext -> folder/file.ext
relative_file = file.gsub(source_folder, "")