@@ -5,15 +5,11 @@ class Console {
55 constructor ( options ) {
66 this . plugins = options . plugins ;
77 this . version = options . version ;
8+ this . contractsConfig = options . contractsConfig ;
89 }
910
1011 runCode ( code ) {
11- try {
12- RunCode . doEval ( code ) ; // jshint ignore:line
13- } catch ( e ) {
14- console . log ( code ) ;
15- console . debug ( e ) ;
16- }
12+ RunCode . doEval ( code ) ; // jshint ignore:line
1713 }
1814
1915 processEmbarkCmd ( cmd ) {
@@ -22,6 +18,7 @@ class Console {
2218 'Welcome to Embark ' + this . version ,
2319 '' ,
2420 'possible commands are:' ,
21+ 'versions - display versions in use for libraries and tools like web3 and solc' ,
2522 // TODO: only if the blockchain is actually active!
2623 // will need to pass te current embark state here
2724 'web3 - instantiated web3.js object configured to the current environment' ,
@@ -30,6 +27,20 @@ class Console {
3027 'The web3 object and the interfaces for the deployed contracts and their methods are also available'
3128 ] ;
3229 return helpText . join ( '\n' ) ;
30+ } else if ( cmd === 'versions' ) {
31+ //let currentSolcVersion = require('../../package.json').dependencies.solc;
32+ let solcVersionInConfig = this . contractsConfig . versions . solc ;
33+
34+ //let web3Version = require('../../package.json').dependencies["web3.js"].replace("^","");
35+ let web3VersionInConfig = this . contractsConfig . versions [ "web3.js" ] ;
36+
37+ let text = [
38+ 'versions in use:' ,
39+ 'solc: ' + solcVersionInConfig ,
40+ 'web3.js: ' + web3VersionInConfig
41+ ]
42+
43+ return text . join ( '\n' ) ;
3344 } else if ( cmd === 'quit' ) {
3445 utils . exit ( ) ;
3546 }
0 commit comments