Skip to content

get-metadata: fail with a non-zero exit status #199

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

Merged
merged 2 commits into from
Mar 5, 2018

Conversation

ryzokuken
Copy link
Contributor

@ryzokuken ryzokuken commented Mar 5, 2018

Fixes: #130

@joyeecheung @cPhost Please take a look. I hope this is what was needed to be done.

@codecov
Copy link

codecov bot commented Mar 5, 2018

Codecov Report

Merging #199 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #199   +/-   ##
=======================================
  Coverage   93.73%   93.73%           
=======================================
  Files          17       17           
  Lines         654      654           
=======================================
  Hits          613      613           
  Misses         41       41

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 a992a24...f64c874. Read the comment docs.

return getMetadata(Object.assign({}, config, argv, parsed), cli)
.then(({status}) => {
if (status === false) {
process.exit(1);
Copy link
Member

Choose a reason for hiding this comment

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

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 :/)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think you mean process.exit(1)?

Copy link
Member

@joyeecheung joyeecheung Mar 5, 2018

Choose a reason for hiding this comment

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

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);
    });

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. That was exactly what I had been thinking about.

@ryzokuken
Copy link
Contributor Author

@joyeecheung take a look now.

@joyeecheung joyeecheung merged commit 02c281e into nodejs:master Mar 5, 2018
@BridgeAR
Copy link
Member

BridgeAR commented Mar 5, 2018

@ryzokuken thanks a lot!

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.

3 participants