Merge pull request #5464 from jekyll/allow-regular-windows-watchers
Merge pull request 5464
This commit is contained in:
commit
f8ec71af3b
|
@ -71,12 +71,17 @@ module Jekyll
|
||||||
#
|
#
|
||||||
# Returns nothing.
|
# Returns nothing.
|
||||||
def watch(site, options)
|
def watch(site, options)
|
||||||
if Utils::Platforms.windows?
|
# Warn Windows users that they might need to upgrade.
|
||||||
Jekyll.logger.warn "", "--watch arg is unsupported on Windows. "
|
if Utils::Platforms.bash_on_windows?
|
||||||
Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \
|
Jekyll.logger.warn "",
|
||||||
"https://github.com/Microsoft/BashOnWindows/issues/216"
|
"Auto-regeneration may not work on some Windows versions."
|
||||||
|
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
|
||||||
|
|
||||||
else
|
|
||||||
External.require_with_graceful_fail "jekyll-watch"
|
External.require_with_graceful_fail "jekyll-watch"
|
||||||
watch_method = Jekyll::Watcher.method(:watch)
|
watch_method = Jekyll::Watcher.method(:watch)
|
||||||
if watch_method.parameters.size == 1
|
if watch_method.parameters.size == 1
|
||||||
|
@ -89,7 +94,6 @@ module Jekyll
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end # end of class << self
|
end # end of class << self
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -19,16 +19,29 @@ module Jekyll
|
||||||
# /proc/version returns nothing to us.
|
# /proc/version returns nothing to us.
|
||||||
# --
|
# --
|
||||||
|
|
||||||
def really_windows?
|
def vanilla_windows?
|
||||||
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
|
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i && \
|
||||||
!proc_version
|
!proc_version
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# --
|
||||||
|
# XXX: Remove in 4.0
|
||||||
|
# --
|
||||||
|
|
||||||
|
alias_method :really_windows?, \
|
||||||
|
:vanilla_windows?
|
||||||
|
|
||||||
|
#
|
||||||
|
|
||||||
|
def bash_on_windows?
|
||||||
|
RbConfig::CONFIG["host_os"] =~ %r!linux! && \
|
||||||
|
proc_version =~ %r!microsoft!i
|
||||||
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
||||||
def windows?
|
def windows?
|
||||||
RbConfig::CONFIG["host_os"] =~ %r!mswin|mingw|cygwin!i || \
|
vanilla_windows? || bash_on_windows?
|
||||||
proc_version =~ %r!microsoft!i
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue