Skip to content

Commit

Permalink
Support running —circular with —-warning
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Jan 13, 2017
1 parent e4e60d0 commit b8a0371
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const log = require('../lib/log');
const output = require('../lib/output');
const madge = require('../lib/api');
const config = Object.assign({}, rc);
let exitCode = 0;

delete config._;
delete config.config;
Expand Down Expand Up @@ -135,7 +136,7 @@ new Promise((resolve, reject) => {
});

if (circular.length) {
process.exit(1);
exitCode = 1;
}

return res;
Expand Down Expand Up @@ -165,6 +166,8 @@ new Promise((resolve, reject) => {
if (program.warning && !program.json) {
output.warnings(res);
}

process.exit(exitCode);
})
.catch((err) => {
output.error(err);
Expand Down

0 comments on commit b8a0371

Please sign in to comment.