Merge pull request #617 from embark-framework/bug_fix/upload-build

set isDev as default if there is no blockchain file
This commit is contained in:
Iuri Matias 2018-07-11 20:19:09 +03:00 committed by GitHub
commit 0b0f092385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 16 deletions

View File

@ -124,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,

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

@ -180,6 +180,9 @@ Config.prototype.loadBlockchainConfigFile = function() {
let configFilePath = this._getFileOrOject(this.configDir, 'blockchain', 'blockchain');
this.blockchainConfig = this._mergeConfig(configFilePath, configObject, this.env, true);
if (!configFilePath) {
this.blockchainConfig.default = true;
}
};
Config.prototype.loadContractsConfigFile = function() {

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;
}
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,