mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Add ability to external pipeline ignore process exit code (#2353)
This commit is contained in:
parent
d7f0ed06d3
commit
a03aed2d6d
1 changed files with 2 additions and 1 deletions
|
@ -6,6 +6,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
||||||
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"
|
option :disable_background_execution, false, "Don't run the command in a separate background thread"
|
||||||
|
option :ignore_exit_code, false, 'Ignore exit code for restart or stop of a command'
|
||||||
|
|
||||||
def initialize(app, options_hash = ::Middleman::EMPTY_HASH, &block)
|
def initialize(app, options_hash = ::Middleman::EMPTY_HASH, &block)
|
||||||
super
|
super
|
||||||
|
@ -67,7 +68,7 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
|
||||||
|
|
||||||
@current_thread.wait
|
@current_thread.wait
|
||||||
|
|
||||||
if !@current_thread.exitstatus.nil? && @current_thread.exitstatus != 0
|
if !options[:ignore_exit_code] && !@current_thread.exitstatus.nil? && @current_thread.exitstatus != 0
|
||||||
logger.error '== External: Command failed with non-zero exit status'
|
logger.error '== External: Command failed with non-zero exit status'
|
||||||
exit(1)
|
exit(1)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue