Created
June 21, 2010 15:26
-
-
Save crallen/447010 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'find' | |
def copy_dir_tree(src_dir, dest_dir, ignored_exts) | |
Find.find(src_dir) do |file| | |
next if ignored_exts.include?(File.extname(file)) | |
if File.directory?(file) | |
mkdir File.join(dest_dir, file) | |
else | |
cp file, File.join(dest_dir, file) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment