Install exit module in cli app

This commit is contained in:
mmcwilliams 2019-02-26 21:09:35 -05:00
parent 8b2095227c
commit fa477aec83
3 changed files with 26 additions and 0 deletions

0
cli/lib/exit/Readme.md Normal file
View File

15
cli/lib/exit/index.js Normal file
View File

@ -0,0 +1,15 @@
'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;

11
cli/lib/exit/package.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "exit",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}