Added option to force watch to use polling

This commit is contained in:
Zequez 2014-03-23 01:09:00 -07:00
parent 862b69c640
commit 5745eb9be8
2 changed files with 6 additions and 1 deletions

View File

@ -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.'

View File

@ -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} "