Merge pull request #1705 from jsdalton/feature/external-pipeline-background-option

Add explicit option to prevent external option from running in backgr…
feature/livereload-locales-data
Thomas Reynolds 2015-12-14 09:50:04 -08:00
commit 79b5e82b3c
1 changed files with 2 additions and 1 deletions

View File

@ -5,6 +5,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
option :command, nil, 'The command to initialize', required: true
option :source, nil, 'Path to merge into sitemap', required: true
option :latency, 0.25, 'Latency between refreshes of source'
option :disable_background_execution, false, "Don't run the command in a separate background thread"
def initialize(app, config={}, &block)
super
@ -19,7 +20,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
def ready
logger.info "== Executing: `#{options[:command]}`"
if app.build?
if app.build? || options[:disable_background_execution]
watch_command!
else
::Thread.new { watch_command! }