From c2c493eb5c62edb9bc32919327afca6012058735 Mon Sep 17 00:00:00 2001 From: dmh Date: Thu, 16 Jun 2016 18:44:21 +0300 Subject: [PATCH] [CHORE] add colors for error messages (add chalk plugin) --- grunt/shell.js | 13 ++++++++----- package.json | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/grunt/shell.js b/grunt/shell.js index 47be042..3676c58 100644 --- a/grunt/shell.js +++ b/grunt/shell.js @@ -1,3 +1,5 @@ +const chalk = require('chalk'); + function isMaster(err, stdout, stderr, cb) { if (err) { cb(err); @@ -9,8 +11,9 @@ function isMaster(err, stdout, stderr, cb) { cb(); return; } else { - console.log('You are not at master brunch!'); - console.log('Please switch to master branch and start script again.'); + console.log(chalk.red('Error!')); + console.log(chalk.red('You are not at master brunch!')); + console.log(chalk.yellow('Please switch to master branch and start script again.')); cb(); process.exit(); } @@ -27,9 +30,9 @@ function isUpdated(err, stdout, stderr, cb) { cb(); return; } else { - console.log('Error!'); - console.log('Your local master branch is not synchronized with remote master.'); - console.log('Please push you changes to remote repo (git push), and start script again.'); + console.log(chalk.red('Error!')); + console.log(chalk.red('Your local master branch is not synchronized with remote master.')); + console.log(chalk.yellow('Please push you changes to remote repo ') + chalk.blue('[git push]') + chalk.yellow(', and start script again.')); cb(); process.exit(); } diff --git a/package.json b/package.json index 2a50849..def7bb0 100644 --- a/package.json +++ b/package.json @@ -6,6 +6,7 @@ "repository": "t3kit/felayout_bluemountain", "devDependencies": { "autoprefixer": "6.3.1", + "chalk": "1.1.3", "grunt": "0.4.5", "grunt-assemble": "0.4.0", "grunt-build-control": "0.6.2",