Skip to content

Commit

Permalink
Return a nonzero exit code if an error is encountered loading config
Browse files Browse the repository at this point in the history
Prior to this an error when loading the config would stop the run but
would not return a negative exit code.

This means that errors in the config could silently disable
markdown-doctest in a CI process.
  • Loading branch information
Widdershin committed Oct 30, 2016
1 parent fe8c782 commit 480b523
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/cmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function main () {
} catch (e) {
console.log('Error running .markdown-doctest-setup.js:');
console.error(e);
process.exitCode = 1;
return;
}
}
Expand All @@ -68,7 +69,7 @@ function main () {
var failures = results.filter(function (result) { return result.status === 'fail'; });

if (failures.length > 0) {
process.exitCode = 127;
process.exitCode = 1;
}
}
}
Expand Down

0 comments on commit 480b523

Please sign in to comment.