From 325800bc59e1a3d6a721c13bba1ca7adcf274b1b Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Mon, 9 Jul 2018 15:20:47 -0400 Subject: [PATCH] set isDev as default if there is no blockchain file --- lib/cmd.js | 12 ++++++++++++ lib/core/config.js | 3 +++ lib/index.js | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/cmd.js b/lib/cmd.js index 51ab0988b..2399d2e10 100644 --- a/lib/cmd.js +++ b/lib/cmd.js @@ -105,6 +105,10 @@ 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); }); } @@ -217,6 +221,10 @@ 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); }); } @@ -231,6 +239,10 @@ 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, diff --git a/lib/core/config.js b/lib/core/config.js index 9ed45e062..c2f21d550 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -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() { diff --git a/lib/index.js b/lib/index.js index 1ed62bfc9..95bca534f 100644 --- a/lib/index.js +++ b/lib/index.js @@ -35,7 +35,7 @@ class Embark { } isDev() { - return this.config && this.config.blockchainConfig && this.config.blockchainConfig.isDev; + return this.config && this.config.blockchainConfig && (this.config.blockchainConfig.isDev || this.config.blockchainConfig.default); } blockchain(env, client) {