2019-02-08 19:07:35 +00:00
|
|
|
'use strict';
|
2019-02-27 02:53:32 +00:00
|
|
|
/**
|
|
|
|
* Exit process with either a 0 code or other
|
|
|
|
* specified failure code. Print message to console first.
|
|
|
|
*
|
|
|
|
* @param {string} msg Reason for exit
|
|
|
|
* @param {integer} code process exit code, default 0
|
|
|
|
**/
|
2019-06-09 00:51:00 +00:00
|
|
|
function exit(msg, code = 0) {
|
|
|
|
if (code === 0) {
|
|
|
|
console.log(msg);
|
|
|
|
process.exit();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
console.error(msg);
|
|
|
|
process.exit(code);
|
|
|
|
}
|
2019-02-08 19:07:35 +00:00
|
|
|
}
|
2024-05-23 22:49:18 +00:00
|
|
|
module.exports = { exit };
|
2019-06-09 00:51:00 +00:00
|
|
|
//# sourceMappingURL=index.js.map
|