Merge pull request #1809 from adam-h/external-pipeline-error

Make build fail when external_pipeline fails
feature/manifest
Thomas Reynolds 2016-02-18 12:48:02 -08:00
commit eaac03ab4b
4 changed files with 18 additions and 4 deletions

View File

@ -43,6 +43,10 @@ Feature: Builder
Given a built app at "empty-app"
Then the exit status should be 1
Scenario: Build external_pipeline errors
Given a built app at "external-pipeline-error"
Then the exit status should be 1
Scenario: Build alias (b)
Given a fixture app "large-build-app"
When I run `middleman b`

View File

@ -0,0 +1,5 @@
activate :external_pipeline,
name: :failing,
command: "mv does-not-exist tmp/file.js",
source: "tmp",
latency: 2

View File

@ -34,6 +34,11 @@ class Middleman::Extensions::ExternalPipeline < ::Middleman::Extension
end
end
unless $?.success?
logger.error '== External: Command failed with non-zero exit status'
exit(1)
end
@watcher.poll_once!
rescue ::Errno::ENOENT => e
logger.error "== External: Command failed with message: #{e.message}"