#!/usr/bin/env node
'use strict';
var chalk = require('chalk');
var envcheck = require('./index');

if (process.argv.indexOf('-h') !== -1 || process.argv.indexOf('--help') !== -1) {
	return console.log('Usage\n  ' + chalk.blue('envcheck') + '\n\nRuns checks against the environment');
}

if (process.argv.indexOf('-v') !== -1 || process.argv.indexOf('--version') !== -1) {
	return console.log(require('./package').version);
}

envcheck(function (err, results) {
	if (err) {
		throw err;
	}

	var fail = false;

	console.log(chalk.underline('\nEnvironment check\n') + results.map(function (el) {
		if (el.fail) {
			fail = true;
			return chalk.red('✘ ' + el.title) + (el.message ? ' - ' + el.message : '');
		}

		return chalk.green('✔ ' + el.title) + (el.message ? ' - ' + el.message : '');
	}).join('\n'));

	process.exit(fail ? 1 : 0);
});

@@ -645,16 +645,17 @@
 red('%E2%9C%98 '
+)
  + el.ti
@@ -649,33 +649,32 @@
 '%E2%9C%98 ') + el.title
-)
  + (el.message ?
@@ -730,16 +730,17 @@
 een('%E2%9C%94 '
+)
  + el.ti
@@ -742,17 +742,16 @@
 el.title
-)
  + (el.m

Make only the status symbol colored