Skip to content
This repository
Browse code

Skip directories when checking for identical source and destination f…

…iles.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2495 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 6b590118626e29f2045ecf53fa200a2f4f6d4472 1 parent a7cdaad
authored October 08, 2005
1  railties/lib/rails_generator/commands.rb
@@ -217,6 +217,7 @@ def file(relative_source, relative_destination, file_options = {}, &block)
217 217
         # passed a block then the source file is a template that needs to first
218 218
         # be evaluated before being compared to the destination.
219 219
         def identical?(source, destination, &block)
  220
+          return false if File.directory? destination
220 221
           source      = block_given? ? File.open(source) {|sf| yield(sf)} : IO.read(source)
221 222
           destination = IO.read(destination)
222 223
           source == destination

0 notes on commit 6b59011

Please sign in to comment.
Something went wrong with that request. Please try again.