remove use of initConfig

This commit is contained in:
Jonathan Rainville 2018-07-10 08:49:08 -04:00 committed by Iuri Matias
parent 6593a92cc4
commit a3d612f8ba
5 changed files with 3 additions and 27 deletions

View File

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

View File

@ -301,7 +301,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 // TODO add other clients at some point
if (client === 'geth') { if (client === 'geth') {
return new Blockchain({blockchainConfig, client: GethCommands, env, isDev, onReadyCallback, onExitCallback}); return new Blockchain({blockchainConfig, client: GethCommands, env, isDev, onReadyCallback, onExitCallback});

View File

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

View File

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

View File

@ -30,10 +30,6 @@ class Embark {
this.plugins = this.config.plugins; this.plugins = this.config.plugins;
} }
isDev() {
return this.config && this.config.blockchainConfig && (this.config.blockchainConfig.isDev || this.config.blockchainConfig.default);
}
blockchain(env, client) { blockchain(env, client) {
this.context = [constants.contexts.blockchain]; this.context = [constants.contexts.blockchain];
return require('./cmds/blockchain/blockchain.js')(this.config.blockchainConfig, client, env, this.isDev(env), () => {}).run(); return require('./cmds/blockchain/blockchain.js')(this.config.blockchainConfig, client, env, this.isDev(env), () => {}).run();
@ -70,7 +66,6 @@ class Embark {
env: options.env, env: options.env,
client: options.client, client: options.client,
locale: options.locale, locale: options.locale,
isDev: this.isDev(),
version: this.version, version: this.version,
embarkConfig: options.embarkConfig || 'embark.json', embarkConfig: options.embarkConfig || 'embark.json',
logFile: options.logFile, logFile: options.logFile,
@ -165,7 +160,6 @@ class Embark {
env: options.env, env: options.env,
client: options.client, client: options.client,
locale: options.locale, locale: options.locale,
isDev: this.isDev(),
version: this.version, version: this.version,
embarkConfig: 'embark.json', embarkConfig: 'embark.json',
interceptLogs: false, interceptLogs: false,
@ -235,7 +229,6 @@ class Embark {
const Engine = require('./core/engine.js'); const Engine = require('./core/engine.js');
const engine = new Engine({ const engine = new Engine({
env: options.env, env: options.env,
isDev: this.isDev(),
version: this.version, version: this.version,
embarkConfig: options.embarkConfig || 'embark.json', embarkConfig: options.embarkConfig || 'embark.json',
logFile: options.logFile, logFile: options.logFile,
@ -290,7 +283,6 @@ class Embark {
env: options.env, env: options.env,
client: options.client, client: options.client,
locale: options.locale, locale: options.locale,
isDev: this.isDev(),
version: this.version, version: this.version,
embarkConfig: 'embark.json', embarkConfig: 'embark.json',
interceptLogs: false, interceptLogs: false,