biiif-cli
Version:
A CLI to Build Static IIIF Collections
15 lines (13 loc) • 312 B
JavaScript
const chalk = require('chalk');
// use to wrap a command to catch and display errors
const withErrors = (command) => {
return async (...args) => {
try {
await command(...args)
} catch (e) {
console.log(chalk.red(e.stack));
process.exitCode = 1;
}
}
}
module.exports = withErrors;