Files
MapLibreParticleLab/scripts/nitpick/index.js

29 lines
620 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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);
};