Skip to content

Commit

Permalink
colorize output when local pm2 version doesnt match in memory daemon
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Jul 29, 2014
1 parent 04fbbb8 commit 78d285f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bin/pm2
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ var fs = require('fs');
var path = p = require('path');
var util = require('util');
var cronJob = require('cron').CronJob;
var chalk = require('chalk');

var Satan = require('../lib/Satan');
var CLI = require('../lib/CLI');
Expand Down Expand Up @@ -458,8 +459,13 @@ if (process.argv.length == 2) {
//
process.once('satan:client:ready', function() {
CLI.getVersion(function(err, remote_version) {
if (!err && (pkg.version != remote_version))
console.log('>>>> In-memory PM2 is out-of-date, do :\n>>>> $ pm2 updatePM2');
if (!err && (pkg.version != remote_version)) {
console.log('');
console.log(chalk.red.bold('>>>> In-memory PM2 is out-of-date, do:\n>>>> $ pm2 updatePM2'));
console.log('In memory PM2 version:', chalk.blue.bold(remote_version));
console.log('Local PM2 version:', chalk.blue.bold(pkg.version));
console.log('');
}
commander.parse(process.argv);
});
});
Expand Down

0 comments on commit 78d285f

Please sign in to comment.