Persist the preview servers options (like port) when reloading
This commit is contained in:
parent
f4feda8b93
commit
8a898f8239
|
@ -41,6 +41,10 @@ module Middleman
|
||||||
|
|
||||||
start_file_watcher unless options[:"disable-watcher"]
|
start_file_watcher unless options[:"disable-watcher"]
|
||||||
|
|
||||||
|
# Save the last-used options so it may be re-used when
|
||||||
|
# reloading later on.
|
||||||
|
@last_options = options
|
||||||
|
|
||||||
@webrick.start
|
@webrick.start
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -56,7 +60,7 @@ module Middleman
|
||||||
# @return [void]
|
# @return [void]
|
||||||
def reload
|
def reload
|
||||||
stop
|
stop
|
||||||
start
|
start @last_options
|
||||||
end
|
end
|
||||||
|
|
||||||
# Stop the current instance, exit Webrick
|
# Stop the current instance, exit Webrick
|
||||||
|
|
Loading…
Reference in a new issue