Skip to content

Commit 02792e2

Browse files
authored
Added force_polling option tho theme.rb (#374)
1 parent d5fd222 commit 02792e2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/zendesk_apps_tools/theme.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ class Theme < Thor
1313
method_option :port, default: Command::DEFAULT_SERVER_PORT, required: false, desc: 'Port for the http server to use.'
1414
method_option :bind, required: false
1515
method_option :livereload, type: :boolean, default: true, desc: 'Enable or disable live-reloading the preview when a change is made.'
16+
method_option :force_polling, type: :boolean, default: false, desc: 'Force the use of the polling adapter.'
1617
def preview
1718
setup_path(options[:path])
1819
ensure_manifest!
@@ -62,7 +63,7 @@ def start_listener(callbacks_after_upload)
6263
# TODO: do we need to stop the listener at some point?
6364
require 'listen'
6465
path = Pathname.new(theme_package_path('.')).cleanpath
65-
listener = ::Listen.to(path, ignore: /\.zat/) do |modified, added, removed|
66+
listener = ::Listen.to(path, ignore: /\.zat/, force_polling: options[:force_polling]) do |modified, added, removed|
6667
need_upload = false
6768
if modified.any? { |file| file[/templates|manifest/] }
6869
need_upload = true

0 commit comments

Comments
 (0)