Skip to content

Commit afa84fa

Browse files
committed
Exit with non-zero status if exec fails
When running `install_dependencies` or `compile`, failures won't halt the host program. This could lead to false positives and difficult to debug scenarios. Consumers would prefer this to fail as early on as possible.
1 parent 211c3e5 commit afa84fa

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
master
22
------
33

4+
* Failures in `{bundle,npm,bower} install` will now fail the host process with a
5+
non-zero exit status. [#236]
46
* Improve error reporting:
57
Redirect `ember build` from `$STDERR` to the build error file. [#245]
68

9+
[#236]: https://github.com/thoughtbot/ember-cli-rails/pull/236
710
[#245]: https://github.com/thoughtbot/ember-cli-rails/pull/245
811

912
0.4.2

lib/ember-cli/app.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ def run
6060

6161
def run_tests
6262
prepare
63-
exit 1 unless exec("#{ember_path} test")
63+
64+
exec("#{ember_path} test")
6465
end
6566

6667
def stop
@@ -343,7 +344,7 @@ def env_hash
343344

344345
def exec(cmd, method: :system)
345346
Dir.chdir root do
346-
Kernel.public_send(method, env_hash, cmd, err: :out)
347+
Kernel.public_send(method, env_hash, cmd, err: :out) || exit(1)
347348
end
348349
end
349350

0 commit comments

Comments
 (0)