Builder.watch: only warn for Bash on Windows, still try watching.

This commit is contained in:
Parker Moore 2016-11-10 12:54:30 -08:00
parent d71dff74ae
commit df45f26187
No known key found for this signature in database
GPG Key ID: 193CDEBA72063C58
1 changed files with 18 additions and 14 deletions

View File

@ -71,23 +71,27 @@ module Jekyll
# #
# Returns nothing. # Returns nothing.
def watch(site, options) def watch(site, options)
# Warn Windows users that they might need to upgrade.
if Utils::Platforms.bash_on_windows? if Utils::Platforms.bash_on_windows?
Jekyll.logger.warn "", "--watch arg is unsupported in Bash on Windows. " Jekyll.logger.warn "",
Jekyll.logger.warn "", "Please see: https://github.com/Microsoft/BashOnWindows/issues/216" "Auto-regeneration may not work on some Windows versions."
Jekyll.logger.warn "", "If iNotify is fixed, please file a ticket." Jekyll.logger.warn "",
"Please see: https://github.com/Microsoft/BashOnWindows/issues/216"
Jekyll.logger.warn "",
"If it does not work, please upgrade Bash on Windows or "\
"run Jekyll with --no-watch."
end
External.require_with_graceful_fail "jekyll-watch"
watch_method = Jekyll::Watcher.method(:watch)
if watch_method.parameters.size == 1
watch_method.call(
options
)
else else
External.require_with_graceful_fail "jekyll-watch" watch_method.call(
watch_method = Jekyll::Watcher.method(:watch) options, site
if watch_method.parameters.size == 1 )
watch_method.call(
options
)
else
watch_method.call(
options, site
)
end
end end
end end
end # end of class << self end # end of class << self