Preventing Jekyll from picking up the output directory as a source

If you attempt to have Jekyll output to a subdirectory of the
source it may recursively copy the destination as it writes it.
This commit is contained in:
Jack Danger Canty 2008-12-10 00:17:52 -08:00
parent f5c727fadb
commit 01828dada8
1 changed files with 4 additions and 3 deletions

View File

@ -86,6 +86,7 @@ module Jekyll
entries.each do |f| entries.each do |f|
if File.directory?(File.join(base, f)) if File.directory?(File.join(base, f))
next if self.dest.sub(/\/$/, '') == File.join(base, f)
transform_pages(File.join(dir, f)) transform_pages(File.join(dir, f))
else else
first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) } first3 = File.open(File.join(self.source, dir, f)) { |fd| fd.read(3) }