Fix #5462: Only shutdown watch in Bash On Windows.
This commit is contained in:
		
							parent
							
								
									74a5297c19
								
							
						
					
					
						commit
						d71dff74ae
					
				|  | @ -71,10 +71,10 @@ module Jekyll | ||||||
|         # |         # | ||||||
|         # Returns nothing. |         # Returns nothing. | ||||||
|         def watch(site, options) |         def watch(site, options) | ||||||
|           if Utils::Platforms.windows? |           if Utils::Platforms.bash_on_windows? | ||||||
|             Jekyll.logger.warn "", "--watch arg is unsupported on Windows. " |             Jekyll.logger.warn "", "--watch arg is unsupported in Bash on Windows. " | ||||||
|             Jekyll.logger.warn "", "If you are on Windows Bash, please see: " \ |             Jekyll.logger.warn "", "Please see: https://github.com/Microsoft/BashOnWindows/issues/216" | ||||||
|               "https://github.com/Microsoft/BashOnWindows/issues/216" |             Jekyll.logger.warn "", "If iNotify is fixed, please file a ticket." | ||||||
| 
 | 
 | ||||||
|           else |           else | ||||||
|             External.require_with_graceful_fail "jekyll-watch" |             External.require_with_graceful_fail "jekyll-watch" | ||||||
|  |  | ||||||
|  | @ -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