Merge pull request #820 from mojombo/fix-autoregen-loop

Fix issue with watching (auto-regeneration) continuously running
This commit is contained in:
Parker Moore 2013-02-22 05:19:11 -08:00
commit f2299a2bf5
2 changed files with 3 additions and 3 deletions

View File

@ -1,9 +1,9 @@
module Jekyll module Jekyll
class Command class Command
def self.globs(source) def self.globs(source, destination)
Dir.chdir(source) do Dir.chdir(source) do
dirs = Dir['*'].select { |x| File.directory?(x) } dirs = Dir['*'].select { |x| File.directory?(x) }
dirs -= ['_site'] dirs -= [destination]
dirs = dirs.map { |x| "#{x}/**/*" } dirs = dirs.map { |x| "#{x}/**/*" }
dirs += ['*'] dirs += ['*']
end end

View File

@ -56,7 +56,7 @@ module Jekyll
dw = DirectoryWatcher.new(source) dw = DirectoryWatcher.new(source)
dw.interval = 1 dw.interval = 1
dw.glob = self.globs(source) dw.glob = self.globs(source, destination)
dw.add_observer do |*args| dw.add_observer do |*args|
t = Time.now.strftime("%Y-%m-%d %H:%M:%S") t = Time.now.strftime("%Y-%m-%d %H:%M:%S")