/** * Wrapper for console logging error messages in color * @param {...any} args arguments to log * @returns {undefined} */ function error(...args) { args.unshift('\n'); console.error(chalk.redBright(...args)); }
client.login(config.credentials.bot_token).catch(err => { console.error(''); console.error(chalk.redBright("Couldn't log into Discord. Wrong bot token?")); console.error(''); console.error(err); process.exit(); });
const handleError = (message) => { console.error(chalk.redBright(message)) process.exitCode = 1 }
// snap rm <names...> // delete one or more boilerplates function rm(names) { console.log(); for (const name of names) { const bplate = path.join(os.homedir(), '.snap', name); if (fs.pathExistsSync(bplate)) { fs.removeSync(bplate); console.log(`${chalk.green('Success:')} ${chalk.redBright(name)} has been deleted!`); } else { console.error(`${chalk.red('Error:')} ${chalk.yellow(name)} does not exist.`); } } console.log(); }
group, METHOD_COLORS[method](method), has_params ? chalk.greenBright('yes') : chalk.redBright('no'), path.replace(/<(\w+)>/g, chalk.cyanBright('<$1>')), wrap(description.endsWith('.') ? description : description + '.', { width: 100, trim: true, indent: '' })
: error ? chalk.redBright('Error ') : chalk.yellow('Warning '); files[url].messages.push({ fatal,
console.log(); console.log( chalk.redBright( ` It seems that there is already a ${chalk.yellow.bold( 'teachcode-solutions',