Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leverage command return value instead of process.exit. #114

Merged

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Feb 19, 2017

Works around an upstream issue in ember-cli 2.13 canary versions, and is quite a bit easier to test.

Also tweaked SIGINT handling to queue up a cancel and avoid additional work. This is because in ember-cli 2.9+ we use capture-exit so that process.exit() does not immediately schedule an exit any longer (so the semantics that we intended with the prior SIGINT logic were generally broken already).

Addresses the issue identified in ember-cli/ember-cli#6779.

task._on('SIGINT', function() {
if (shutdownCount === 0) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, this two phase exit system will not work on recent ember-cli anyways because process.exit() no longer ensures immediate exit (as it did before).

@rwjblue rwjblue force-pushed the use-command-return-value-for-exit-code branch from 5550cb8 to 9971720 Compare February 19, 2017 21:44
@rwjblue
Copy link
Member Author

rwjblue commented Feb 19, 2017

Before this PR (when using ember-cli#master) a failing test suite with ember try:one will report 0 exit code. After this PR (when using ember-cli#master) a failing test suite with ember try:one will report 1 exit code.

You can test using the demo repo I created for ember-cli/ember-cli#6779 (https://github.com/rwjblue/exit-code-incorrect-demo).

Works around an upstream issue in ember-cli 2.13 canary versions,
and is quite a bit easier to test.

Also tweaked SIGINT handling to queue up a cancel and avoid additional
work. This is because in ember-cli 2.9+ we use `capture-exit` so that
`process.exit()` does not immediately schedule an exit any longer (so
the semantics that we intended with the prior SIGINT logic were generally
broken already).
@rwjblue
Copy link
Member Author

rwjblue commented Feb 19, 2017

FWIW, I also confirmed as far back as [email protected] that returning an exit code from a command would affect the resulting process exit code, so this is not a backwards breaking change.

@rwjblue rwjblue merged commit e676104 into ember-cli:master Feb 21, 2017
@rwjblue rwjblue deleted the use-command-return-value-for-exit-code branch February 21, 2017 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant