ci-scripts
Version:
Useful scripts to execute from your CI runner. For example, post to Slack and GitHub when your build completes:
19 lines (14 loc) • 438 B
JavaScript
const chalk = require('chalk');
const isDryRun = require('../isDryRun');
const log = (ci, msg) => {
if (isDryRun(ci)) {
/* eslint-disable no-console */
console.log(chalk.cyan.bold('\n Will log message:'));
console.log(chalk.magenta(`\n ${msg}\n`));
/* eslint-enable no-console */
return;
}
// eslint-disable-next-line no-console
console.log(msg);
};
module.exports = log;