diff --git a/cli/lib/exit/Readme.md b/cli/lib/exit/Readme.md new file mode 100644 index 0000000..e69de29 diff --git a/cli/lib/exit/index.js b/cli/lib/exit/index.js new file mode 100644 index 0000000..f93eb68 --- /dev/null +++ b/cli/lib/exit/index.js @@ -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; \ No newline at end of file diff --git a/cli/lib/exit/package.json b/cli/lib/exit/package.json new file mode 100644 index 0000000..0ab494d --- /dev/null +++ b/cli/lib/exit/package.json @@ -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" +}