提交 81436bdbedf41a62cd20086421b70cd4526c590a

作者 Nick Baugh
2 个父辈 bae1c8db 1ae1d7ef

Merge pull request #15 from adnan-i/feature/local-config

Adds support for local (developer) configuration
正在显示 1 个修改的文件 包含 5 行增加2 行删除
@@ -5,7 +5,7 @@ var _ = require('underscore') @@ -5,7 +5,7 @@ var _ = require('underscore')
5 var util = require('util') 5 var util = require('util')
6 var mergeDefaults = require('merge-defaults') 6 var mergeDefaults = require('merge-defaults')
7 7
8 -exports = module.exports = function(config) { 8 +exports = module.exports = function(config, local) {
9 9
10 var settings = {} 10 var settings = {}
11 11
@@ -14,7 +14,10 @@ exports = module.exports = function(config) { @@ -14,7 +14,10 @@ exports = module.exports = function(config) {
14 if (!_.isObject(config[env])) 14 if (!_.isObject(config[env]))
15 throw new Error(util.format('Unknown environment %s', env)) 15 throw new Error(util.format('Unknown environment %s', env))
16 16
17 - mergeDefaults(settings, config[env], config.defaults) 17 + if (!_.isObject(local))
  18 + local = {}
  19 +
  20 + mergeDefaults(settings, local, config[env], config.defaults)
18 21
19 return settings 22 return settings
20 23
注册登录 后发表评论