Fix first-run issue with pipeline

feature/livereload-locales-data
Thomas Reynolds 2015-12-08 14:46:03 -08:00
parent 2178a755e2
commit cb6e8bcd95
1 changed files with 9 additions and 8 deletions

View File

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