When writing a set of files, only write to valid directories.
This fixes issue #40
This commit is contained in:
parent
b630d61ed1
commit
50e5d23f0a
1 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
|
|
Reference in a new issue