From d590d7a73863c896e3fe0292e8b2976172fa91f7 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Mon, 18 Jul 2016 00:01:27 -0600 Subject: [PATCH] resolves #4858 pass site instance to watch plugin - prevents the watch plugin from creating a new site instance --- lib/jekyll/commands/build.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jekyll/commands/build.rb b/lib/jekyll/commands/build.rb index cef13c91..38c584c7 100644 --- a/lib/jekyll/commands/build.rb +++ b/lib/jekyll/commands/build.rb @@ -70,9 +70,14 @@ module Jekyll # options - A Hash of options passed to the command # # Returns nothing. - def watch(_site, options) + def watch(site, options) External.require_with_graceful_fail "jekyll-watch" - Jekyll::Watcher.watch(options) + watch_method = Jekyll::Watcher.method(:watch) + if watch_method.parameters.size == 1 + watch_method.call(options) + else + watch_method.call(options, site) + end end end # end of class << self end