define version in the main object

This commit is contained in:
Iuri Matias 2016-10-30 22:37:06 -04:00
parent 59f9d9fdf0
commit 0a26fa98ce
3 changed files with 8 additions and 4 deletions

View File

@ -3,7 +3,7 @@ var colors = require('colors');
var Cmd = function(Embark) {
this.Embark = Embark;
program.version('2.1.3');
program.version(Embark.version);
};
Cmd.prototype.process = function(args) {

View File

@ -26,6 +26,8 @@ var IPFS = require('./ipfs.js');
var Embark = {
version: '2.1.3',
process: function(args) {
var cmd = new Cmd(Embark);
cmd.process(args);
@ -66,7 +68,7 @@ var Embark = {
function welcome(callback) {
if (!options.useDashboard) {
console.log('========================'.bold.green);
console.log('Welcome to Embark 2.1.3'.yellow.bold);
console.log(('Welcome to Embark ' + Embark.version).yellow.bold);
console.log('========================'.bold.green);
}
callback();
@ -96,7 +98,8 @@ var Embark = {
config: Embark.config,
serverHost: options.serverHost,
serverPort: options.serverPort,
runWebserver: options.runWebserver
runWebserver: options.runWebserver,
version: Embark.version
});
Embark.servicesMonitor.startMonitor();
callback();

View File

@ -9,6 +9,7 @@ var ServicesMonitor = function(options) {
this.serverHost = options.serverHost || 'localhost';
this.serverPort = options.serverPort || 8000;
this.runWebserver = options.runWebserver;
this.version = options.version;
};
ServicesMonitor.prototype.startMonitor = function() {
@ -30,7 +31,7 @@ ServicesMonitor.prototype.check = function() {
},
function addEmbarkVersion(web3, result, callback) {
self.logger.trace('addEmbarkVersion');
result.push('Embark 2.1.3'.green);
result.push(('Embark ' + self.version).green);
callback(null, web3, result);
},
function checkEthereum(web3, result, callback) {