Merge pull request #1782 from jsdalton/allow-watcher-disable-in-server-mode

Disable file watching completely when watcher_disable is true
This commit is contained in:
Thomas Reynolds 2016-01-28 00:05:40 -08:00
commit e169d3d07e

View file

@ -151,6 +151,7 @@ module Middleman
config[:ssl_private_key] = opts[:ssl_private_key] if opts[:ssl_private_key] config[:ssl_private_key] = opts[:ssl_private_key] if opts[:ssl_private_key]
ready do ready do
unless config[:watcher_disable]
match_against = [ match_against = [
%r{^config\.rb$}, %r{^config\.rb$},
%r{^environments/[^\.](.*)\.rb$}, %r{^environments/[^\.](.*)\.rb$},
@ -163,7 +164,6 @@ module Middleman
path: root, path: root,
only: match_against only: match_against
unless config[:watcher_disable]
# Hack around node_modules in root. # Hack around node_modules in root.
watcher.listener.ignore(/^node_modules/) watcher.listener.ignore(/^node_modules/)