Fix first-run issue with pipeline

This commit is contained in:
Thomas Reynolds 2015-12-08 14:46:03 -08:00
parent 2178a755e2
commit cb6e8bcd95

View file

@ -11,17 +11,18 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
require 'thread' require 'thread'
app.files.watch :source, @watcher = app.files.watch :source,
path: File.expand_path(options[:source], app.root), path: File.expand_path(options[:source], app.root),
latency: options[:latency] latency: options[:latency]
end end
def ready def ready
if app.build? logger.info "== Executing: `#{options[:command]}`"
logger.info "== Executing: `#{options[:command]}`"
watch_command! watch_command!
else @watcher.poll_once!
logger.debug "== Executing: `#{options[:command]}`"
if !app.build?
::Thread.new { watch_command! } ::Thread.new { watch_command! }
end end
end end