remove use of initConfig

This commit is contained in:
Jonathan Rainville 2018-07-10 08:49:08 -04:00
parent 325800bc59
commit 2a6d1cf3fe
5 changed files with 4 additions and 28 deletions

View File

@ -105,10 +105,6 @@ class Cmd {
_options.logLevel = _options.loglevel; // fix casing
_options.onlyCompile = _options.contracts;
_options.client = _options.client || 'geth';
embark.initConfig(env || 'development', {
embarkConfig: 'embark.json',
interceptLogs: false
});
embark.build(_options);
});
}
@ -128,10 +124,6 @@ class Cmd {
.description(__('run dapp (default: %s)', 'development'))
.action(function (env, options) {
i18n.setOrDetectLocale(options.locale);
embark.initConfig(env || 'development', {
embarkConfig: 'embark.json',
interceptLogs: false
});
embark.run({
env: env || 'development',
serverPort: options.port,
@ -221,10 +213,6 @@ class Cmd {
_options.logFile = _options.logfile; // fix casing
_options.logLevel = _options.loglevel; // fix casing
_options.client = _options.client || 'geth';
embark.initConfig(env || 'development', {
embarkConfig: 'embark.json',
interceptLogs: false
});
embark.upload(_options);
});
}
@ -239,10 +227,6 @@ class Cmd {
.description(__('generates documentation based on the smart contracts configured'))
.action(function (env, options) {
i18n.setOrDetectLocale(options.locale);
embark.initConfig(env || 'development', {
embarkConfig: 'embark.json',
interceptLogs: false
});
embark.graph({
env: env || 'development',
logFile: options.logfile,

View File

@ -285,7 +285,8 @@ Blockchain.prototype.initChainAndGetAddress = function(callback) {
});
};
var BlockchainClient = function(blockchainConfig, client, env, isDev, onReadyCallback, onExitCallback) {
var BlockchainClient = function(blockchainConfig, client, env, onReadyCallback, onExitCallback) {
const isDev = blockchainConfig.isDev || blockchainConfig.default;
// TODO add other clients at some point
if (client === 'geth') {
return new Blockchain({blockchainConfig, client: GethCommands, env, isDev, onReadyCallback, onExitCallback});

View File

@ -20,7 +20,6 @@ class BlockchainProcess extends ProcessWrapper {
this.blockchainConfig,
this.client,
this.env,
this.isDev,
this.blockchainReady.bind(this),
this.blockchainExit.bind(this)
);

View File

@ -6,7 +6,6 @@ const IPC = require('./ipc');
class Engine {
constructor(options) {
this.env = options.env;
this.isDev = options.isDev;
this.client = options.client;
this.locale = options.locale;
this.embarkConfig = options.embarkConfig;
@ -30,6 +29,7 @@ class Engine {
this.config = new Config({env: this.env, logger: this.logger, events: this.events, context: this.context});
this.config.loadConfigFiles({embarkConfig: this.embarkConfig, interceptLogs: this.interceptLogs});
this.plugins = this.config.plugins;
this.isDev = this.config && this.config.blockchainConfig && (this.config.blockchainConfig.isDev || this.config.blockchainConfig.default);
if (this.interceptLogs || this.interceptLogs === undefined) {
this.doInterceptLogs();

View File

@ -34,13 +34,9 @@ class Embark {
this.plugins = this.config.plugins;
}
isDev() {
return this.config && this.config.blockchainConfig && (this.config.blockchainConfig.isDev || this.config.blockchainConfig.default);
}
blockchain(env, client) {
this.context = [constants.contexts.blockchain];
return require('./cmds/blockchain/blockchain.js')(this.config.blockchainConfig, client, env, this.isDev()).run();
return require('./cmds/blockchain/blockchain.js')(this.config.blockchainConfig, client, env).run();
}
simulator(options) {
@ -74,7 +70,6 @@ class Embark {
env: options.env,
client: options.client,
locale: options.locale,
isDev: this.isDev(),
version: this.version,
embarkConfig: options.embarkConfig || 'embark.json',
logFile: options.logFile,
@ -168,7 +163,6 @@ class Embark {
env: options.env,
client: options.client,
locale: options.locale,
isDev: this.isDev(),
version: this.version,
embarkConfig: 'embark.json',
interceptLogs: false,
@ -238,7 +232,6 @@ class Embark {
const Engine = require('./core/engine.js');
const engine = new Engine({
env: options.env,
isDev: this.isDev(),
version: this.version,
embarkConfig: options.embarkConfig || 'embark.json',
logFile: options.logFile,
@ -293,7 +286,6 @@ class Embark {
env: options.env,
client: options.client,
locale: options.locale,
isDev: this.isDev(),
version: this.version,
embarkConfig: 'embark.json',
interceptLogs: false,