fix getting .json config file

This commit is contained in:
Iuri Matias 2018-05-11 18:22:03 -04:00
parent 2793432b87
commit b804f51de5
1 changed files with 2 additions and 2 deletions

View File

@ -75,7 +75,7 @@ Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, ena
return configToReturn; return configToReturn;
} }
if (!fs.existsSync(configFilePath + '.js') && !fs.existsSync(configFilePath + ' .json')) { if (!fs.existsSync(configFilePath + '.js') && !fs.existsSync(configFilePath + '.json')) {
// TODO: remove this if // TODO: remove this if
if (this.logger) { if (this.logger) {
this.logger.warn(__("no config file found at %s using default config", configFilePath)); this.logger.warn(__("no config file found at %s using default config", configFilePath));
@ -87,7 +87,7 @@ Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, ena
if (fs.existsSync(configFilePath + '.js')) { if (fs.existsSync(configFilePath + '.js')) {
config = require(fs.dappPath(configFilePath + '.js')); config = require(fs.dappPath(configFilePath + '.js'));
} else { } else {
config = fs.readJSONSync(configFilePath); config = fs.readJSONSync(configFilePath + '.json');
} }
let configObject = utils.recursiveMerge(defaultConfig, config); let configObject = utils.recursiveMerge(defaultConfig, config);