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

Keep exit code from outer scope #89

Merged
merged 1 commit into from
Jan 9, 2018
Merged

Keep exit code from outer scope #89

merged 1 commit into from
Jan 9, 2018

Conversation

gfranco
Copy link
Contributor

@gfranco gfranco commented Jan 6, 2018

Not sure is it a bug, but coa doesn't keep an exit code if process.exit was called somewhere outside.

process.once('uncaughtException', () => {
  process.exit(1);
});

setTimeout(() => {
  throw Error('0_o');
}, 500);

require('coa').Cmd()
  .name('Ololo').title('Ololo')
  .act(() => {
    setTimeout(() => console.log('OK'), 1000);
  })
  .run(process.argv.slice(2));

Expected Result:
Exit code 1

Actual Result:
Exit code 0

@coveralls
Copy link

Coverage Status

Coverage remained the same at 69.714% when pulling 54ff3f6 on gfranco:patch-1 into 05bd8dd on veged:master.

@qfox qfox merged commit 0a8777d into veged:master Jan 9, 2018
@qfox
Copy link
Collaborator

qfox commented Jan 9, 2018

Thank you very much, I'll try to publish this asap.

@qfox
Copy link
Collaborator

qfox commented Jan 10, 2018

Published in 2.0.1

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.

None yet

3 participants