[Rake-devel] [PATCH] clean.rb, directories

Daniel Berger Daniel.Berger at qwest.com
Fri Feb 2 17:40:00 EST 2007


Hi,

This is a patch for the clean task, so that it only deletes files, not 
directories.

--- clean.orig  Fri Feb  2 15:30:56 2007
+++ clean.rb    Fri Feb  2 15:35:18 2007
@@ -20,7 +20,10 @@

  desc "Remove any temporary products."
  task :clean do
-  CLEAN.each { |fn| rm_r fn rescue nil }
+  CLEAN.each { |fn|
+     next if File.directory?(fn)
+     rm_r fn rescue nil
+  }
  end

  CLOBBER = Rake::FileList.new

This addresses an earlier email where someone brought up the fact that 
"rake clean" deletes a directory named 'core', not just core files. 
Since I hit it myself recently, I figure I should submit a patch. :)

Regards,

Dan


More information about the Rake-devel mailing list