Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
main
------

* Raise `EmberCli::BuildError` when `ember build` or a dependency
installation fails, instead of exiting the process from inside the gem —
`rake ember:compile` and `rake ember:install` still exit nonzero

0.13.1
------

Expand Down
4 changes: 3 additions & 1 deletion lib/ember_cli/runner.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
require "open3"

require "ember_cli/errors"

module EmberCli
class Runner
def initialize(out:, err:, env: {}, options: {})
Expand All @@ -25,7 +27,7 @@ def run(command)
def run!(command)
run(command).tap do |status|
unless status.success?
exit status.exitstatus
fail BuildError, "`#{command}` failed with status #{status.exitstatus}"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/ember_cli/runner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
)

expect { runner.run!(command_with_error(out: "out")) }.
to raise_error(SystemExit)
to raise_error(EmberCli::BuildError, /failed with status 1/)

expect(split_output_from_stream(stdout)).to eq(%w[out out])
expect(split_output_from_stream(logfile)).to eq(%w[out out])
Expand All @@ -27,7 +27,7 @@
)

expect { runner.run!(command_with_error(err: "err")) }.
to raise_error(SystemExit)
to raise_error(EmberCli::BuildError, /failed with status 1/)

expect(split_output_from_stream(stderr)).to eq(%w[err err])
expect(split_output_from_stream(logfile)).to eq(%w[err err])
Expand Down