Browse code

:copydot ignores thumbnail files starting with '._'

Frederic Hemberger authored on 10/12/2011 at 13:42:31
Showing 1 changed files
... ...
@@ -217,11 +217,8 @@ end
217 217
 
218 218
 desc "copy dot files for deployment"
219 219
 task :copydot, :source, :dest do |t, args|
220
-  exclusions = [".", "..", ".DS_Store"]
221
-  Dir["#{args.source}/**/.*"].each do |file|
222
-    if !File.directory?(file) && !exclusions.include?(File.basename(file))
223
-      cp(file, file.gsub(/#{args.source}/, "#{args.dest}"));
224
-    end
220
+  FileList["#{args.source}/**/.*"].exclude("**/.", "**/..", "**/.DS_Store", "**/._*").each do |file|
221
+    cp_r file, file.gsub(/#{args.source}/, "#{args.dest}") unless File.directory?(file)
225 222
   end
226 223
 end
227 224