Permalink
Browse files

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

This fixes issue #40
  • Loading branch information...
1 parent b630d61 commit 50e5d23f0adfa8abe3e427b8ddb29d4324904f05 @scelis committed Sep 16, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 lib/twine/formatters/abstract.rb
@@ -153,9 +153,11 @@ def write_all_files(path)
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

0 comments on commit 50e5d23

Please sign in to comment.