dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Adding the ability to set exit codes from command rejections #114

Closed rorticus closed 7 years ago

rorticus commented 7 years ago

Type: feature

The following has been addressed in the PR:

Description:

Commands can now reject with CommandErrors now instead of regular errors. These are backwards compatible with the current Error objects.

return Promise.reject({
    message: 'Some error message',
    exitCode: 1
});

If exitCode is returned, and not undefined, the process will be exited with that exit code.

Part of https://github.com/dojo/cli-test-intern/issues/7

codecov-io commented 7 years ago

Codecov Report

Merging #114 into master will increase coverage by <.01%. The diff coverage is 100%.

@@            Coverage Diff             @@
##           master     #114      +/-   ##
==========================================
+ Coverage   99.45%   99.45%   +<.01%     
==========================================
  Files          15       15              
  Lines         364      368       +4     
  Branches       40       42       +2     
==========================================
+ Hits          362      366       +4     
  Partials        2        2
Impacted Files Coverage Δ
src/registerCommands.ts 100% <100%> (ø) :white_check_mark:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 59926aa...475216c. Read the comment docs.