mirror of
https://github.com/jekyll/jekyll.git
synced 2026-01-31 17:58:29 -05:00
Merge pull request #820 from mojombo/fix-autoregen-loop
Fix issue with watching (auto-regeneration) continuously running
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
module Jekyll
|
||||
class Command
|
||||
def self.globs(source)
|
||||
def self.globs(source, destination)
|
||||
Dir.chdir(source) do
|
||||
dirs = Dir['*'].select { |x| File.directory?(x) }
|
||||
dirs -= ['_site']
|
||||
dirs -= [destination]
|
||||
dirs = dirs.map { |x| "#{x}/**/*" }
|
||||
dirs += ['*']
|
||||
end
|
||||
|
||||
@@ -56,7 +56,7 @@ module Jekyll
|
||||
|
||||
dw = DirectoryWatcher.new(source)
|
||||
dw.interval = 1
|
||||
dw.glob = self.globs(source)
|
||||
dw.glob = self.globs(source, destination)
|
||||
|
||||
dw.add_observer do |*args|
|
||||
t = Time.now.strftime("%Y-%m-%d %H:%M:%S")
|
||||
|
||||
Reference in New Issue
Block a user