Make build fail when external_pipeline fails
This commit is contained in:
parent
476287452d
commit
351003b4fe
4 changed files with 18 additions and 4 deletions
|
@ -20,13 +20,13 @@ Feature: Builder
|
|||
| layout |
|
||||
| layouts/custom |
|
||||
| layouts/content_for |
|
||||
|
||||
|
||||
And the file "index.html" should contain "Comment in layout"
|
||||
And the file "index.html" should contain "<h1>Welcome</h1>"
|
||||
And the file "static.html" should contain "Static, no code!"
|
||||
And the file "services/index.html" should contain "Services"
|
||||
And the file "stylesheets/static.css" should contain "body"
|
||||
|
||||
|
||||
Scenario: Build glob
|
||||
Given a successfully built app at "glob-app" with flags "--glob '*.css'"
|
||||
When I cd to "build"
|
||||
|
@ -34,15 +34,19 @@ Feature: Builder
|
|||
| index.html |
|
||||
Then the following files should exist:
|
||||
| stylesheets/site.css |
|
||||
|
||||
|
||||
Scenario: Build with errors
|
||||
Given a built app at "build-with-errors-app"
|
||||
Then the exit status should be 1
|
||||
|
||||
|
||||
Scenario: Build empty errors
|
||||
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`
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
activate :external_pipeline,
|
||||
name: :failing,
|
||||
command: "mv does-not-exist tmp/file.js",
|
||||
source: "tmp",
|
||||
latency: 2
|
|
@ -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}"
|
||||
|
|
Loading…
Reference in a new issue