UNPKG

travis-deploy-once

Version:

Run a deployment script only once in the Travis test matrix

18 lines (16 loc) 454 B
const chalk = require('chalk'); /** * @param {String} namespace log prefix. * * @returns {Object} Logger with `log` and `error` function. */ module.exports = namespace => { return { log(...args) { console.log(`${namespace ? `${chalk.magenta(`[${namespace}]:`)} ` : ''}${args.join()}`); }, error(...args) { console.error(`${namespace ? `${chalk.magenta(`[${namespace}]:`)} ` : ''}${chalk.red(args.join())}`); }, }; };