parent
18da6362ba
commit
d4f5e4db29
|
@ -7,6 +7,7 @@ Master
|
|||
* Avoid looking in binary files for frontmatter. #728
|
||||
* Allow nested i18n files. #725
|
||||
* Better adapt to Rack interface. #709
|
||||
* Add --force-polling flag. #730, #644
|
||||
|
||||
3.0.9
|
||||
====
|
||||
|
|
|
@ -29,7 +29,7 @@ module Middleman::Cli
|
|||
:type => :string,
|
||||
:default => false,
|
||||
:desc => 'Print instrument messages'
|
||||
method_option "disable-watcher",
|
||||
method_option :disable_watcher,
|
||||
:type => :boolean,
|
||||
:default => false,
|
||||
:desc => 'Disable the file change and delete watcher process'
|
||||
|
@ -41,6 +41,10 @@ module Middleman::Cli
|
|||
:type => :string,
|
||||
:default => false,
|
||||
:desc => 'Additional paths to auto-reload when files change'
|
||||
method_option :force_polling,
|
||||
:type => :boolean,
|
||||
:default => false,
|
||||
:desc => 'Force file watcher into polling mode'
|
||||
|
||||
# Start the server
|
||||
def server
|
||||
|
@ -60,8 +64,9 @@ module Middleman::Cli
|
|||
:environment => options["environment"],
|
||||
:debug => options["verbose"],
|
||||
:instrumenting => options["instrument"],
|
||||
:"disable-watcher" => options["disable-watcher"],
|
||||
:reload_paths => options["reload_paths"]
|
||||
:disable_watcher => options["disable_watcher"],
|
||||
:reload_paths => options["reload_paths"],
|
||||
:force_polling => options["force_polling"]
|
||||
}
|
||||
|
||||
puts "== The Middleman is loading"
|
||||
|
|
|
@ -80,14 +80,14 @@ module Middleman
|
|||
end
|
||||
|
||||
def start_file_watcher
|
||||
return if @options[:"disable-watcher"]
|
||||
return if @options[:disable_watcher]
|
||||
|
||||
first_run = !@listener
|
||||
|
||||
if first_run
|
||||
# Watcher Library
|
||||
require "listen"
|
||||
@listener = Listen.to(Dir.pwd, :relative_paths => true)
|
||||
@listener = Listen.to(Dir.pwd, :relative_paths => true, :force_polling => @options[:force_polling])
|
||||
end
|
||||
|
||||
@listener.change do |modified, added, removed|
|
||||
|
|
Loading…
Reference in a new issue