Skip to content

Commit

Permalink
Fix issue with watching (auto-regeneration) continuously running if d…
Browse files Browse the repository at this point in the history
…estination is not '_site'. #457.
  • Loading branch information
parkr committed Feb 21, 2013
1 parent a22527c commit 7457cba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/jekyll/command.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll/commands/build.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def self.watch(site, options)

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")
Expand Down

2 comments on commit 7457cba

@parkr
Copy link
Member Author

@parkr parkr commented on 7457cba Mar 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, yeah, it looks like it just keeps going. Is this when you just use the programmatic default, or when you specify _site in your _config.yml?

@parkr
Copy link
Member Author

@parkr parkr commented on 7457cba Mar 16, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wrote some tests and fixed it up a bit: #862.

Please sign in to comment.