diff options
Diffstat (limited to 'scripts/nitpick/index.js')
-rw-r--r-- | scripts/nitpick/index.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/nitpick/index.js b/scripts/nitpick/index.js new file mode 100644 index 0000000000..31316e7521 --- /dev/null +++ b/scripts/nitpick/index.js @@ -0,0 +1,28 @@ +var failed = false; + +process.on('exit', function() { + if (failed) { + process.exitCode = 1; + } +}); + +module.exports = function(status, str, desc) { + if (status) { + console.warn(`\x1b[1m\x1b[32m✔︎ ${str}\x1b[0m`); + } else { + console.warn(`\x1b[1m\x1b[31m✘ ${str}\x1b[0m`); + failed = true; + } + + if (desc) { + console.warn(`${desc.split('\n').map((line) => '| ' + line).join('\n')}\n`); + } +}; + +module.exports.ok = function(str, desc) { + module.exports(true, str, desc); +}; + +module.exports.fail = function(str, desc) { + module.exports(false, str, desc); +}; |