Merge pull request #1705 from jsdalton/feature/external-pipeline-background-option
Add explicit option to prevent external option from running in backgr…
This commit is contained in:
commit
79b5e82b3c
|
@ -5,6 +5,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
||||||
option :command, nil, 'The command to initialize', required: true
|
option :command, nil, 'The command to initialize', required: true
|
||||||
option :source, nil, 'Path to merge into sitemap', required: true
|
option :source, nil, 'Path to merge into sitemap', required: true
|
||||||
option :latency, 0.25, 'Latency between refreshes of source'
|
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)
|
def initialize(app, config={}, &block)
|
||||||
super
|
super
|
||||||
|
@ -19,7 +20,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
||||||
def ready
|
def ready
|
||||||
logger.info "== Executing: `#{options[:command]}`"
|
logger.info "== Executing: `#{options[:command]}`"
|
||||||
|
|
||||||
if app.build?
|
if app.build? || options[:disable_background_execution]
|
||||||
watch_command!
|
watch_command!
|
||||||
else
|
else
|
||||||
::Thread.new { watch_command! }
|
::Thread.new { watch_command! }
|
||||||
|
|
Loading…
Reference in a new issue