When writing a set of files, only write to valid directories.

This fixes issue #40
This commit is contained in:
Sebastian Celis 2013-09-16 08:11:57 -05:00
parent b630d61ed1
commit 50e5d23f0a

View file

@ -153,9 +153,11 @@ module Twine
file_name = @options[:file_name] || default_file_name
Dir.foreach(path) do |item|
lang = determine_language_given_path(item)
if lang
write_file(File.join(path, item, file_name), lang)
if File.directory?(item)
lang = determine_language_given_path(item)
if lang
write_file(File.join(path, item, file_name), lang)
end
end
end
end