mcopy/cli/lib/exit/index.js

15 lines
224 B
JavaScript
Raw Normal View History

2019-02-27 02:09:35 +00:00
'use strict';
const log = require('log')({quiet : false})
function exit (msg, code = 0) {
if (code === 0) {
log.info(msg);
process.exit();
} else {
log.error(msg);
process.exit(code);
}
}
module.exports = exit;