get-metadata: fail with a non-zero exit status#199
get-metadata: fail with a non-zero exit status#199joyeecheung merged 2 commits intonodejs:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #199 +/- ##
=======================================
Coverage 93.73% 93.73%
=======================================
Files 17 17
Lines 654 654
=======================================
Hits 613 613
Misses 41 41Continue to review full report at Codecov.
|
components/git/metadata.js
Outdated
| return getMetadata(Object.assign({}, config, argv, parsed), cli) | ||
| .then(({status}) => { | ||
| if (status === false) { | ||
| process.exit(1); |
There was a problem hiding this comment.
I think we can just let this throw here so it goes to the catch below, and replace process.exit(-1) below to process.exit(-1)? (I don't even know what I was thinking when I put -1 there :/)
There was a problem hiding this comment.
I think you mean process.exit(1)?
There was a problem hiding this comment.
Yes, like so
.then(({status}) => {
if (status === false) {
throw new Error(`PR checks failed`);
}
})
.catch((err) => {
if (cli.spinner.enabled) {
cli.spinner.fail();
}
cli.error(err);
process.exit(1);
});There was a problem hiding this comment.
Cool. That was exactly what I had been thinking about.
|
@joyeecheung take a look now. |
|
@ryzokuken thanks a lot! |
Fixes: #130
@joyeecheung @cPhost Please take a look. I hope this is what was needed to be done.