From 5745eb9be8d12a642f7ad842ccc0dd7e3c055219 Mon Sep 17 00:00:00 2001 From: Zequez Date: Sun, 23 Mar 2014 01:09:00 -0700 Subject: [PATCH] Added option to force watch to use polling --- lib/jekyll/command.rb | 1 + lib/jekyll/commands/build.rb | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/jekyll/command.rb b/lib/jekyll/command.rb index 7bdf19ca..957e9825 100644 --- a/lib/jekyll/command.rb +++ b/lib/jekyll/command.rb @@ -67,6 +67,7 @@ module Jekyll c.option 'future', '--future', 'Publishes posts with a future date' c.option 'limit_posts', '--limit_posts MAX_POSTS', Integer, 'Limits the number of posts to parse and publish' c.option 'watch', '-w', '--watch', 'Watch for changes and rebuild' + c.option 'force_polling', '--force_polling', 'Force watch to use polling' c.option 'lsi', '--lsi', 'Use LSI for improved related posts' c.option 'show_drafts', '-D', '--drafts', 'Render posts in the _drafts folder' c.option 'quiet', '-q', '--quiet', 'Silence output.' diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index bdd475cf..b1636c88 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -69,7 +69,11 @@ module Jekyll Jekyll.logger.info "Auto-regeneration:", "enabled" - listener = Listen.to(source, :ignore => ignored) do |modified, added, removed| + listener = Listen.to( + source, + :ignore => ignored, + :force_polling => options['force_polling'] + ) do |modified, added, removed| t = Time.now.strftime("%Y-%m-%d %H:%M:%S") n = modified.length + added.length + removed.length print Jekyll.logger.formatted_topic("Regenerating:") + "#{n} files at #{t} "