Fix first-run issue with pipeline
This commit is contained in:
parent
2178a755e2
commit
cb6e8bcd95
1 changed files with 9 additions and 8 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue