Commit 167f5484 authored by Leo Iannacone's avatar Leo Iannacone

use extend module to merge configurations - closes #2

parent a3b29d9f
#
# * Please DO NOT edit this file.
# *
......@@ -6,6 +5,8 @@
# *
#
extend = require('extend')
# #start config-auto-export
config = {}
......@@ -101,18 +102,7 @@ try
if user_config
console.log "Reading user configutation ..."
# * update object1 with object2 values
_merge = (object1, object2) ->
result = {}
for p of object1
if object2.hasOwnProperty(p)
if typeof object1[p] is "object" and typeof object2[p] is "object"
result[p] = _merge(object1[p], object2[p])
else
result[p] = object2[p]
else
result[p] = object1[p]
return result
config = _merge(config, require(user_config))
config = extend(true, {}, config, require(user_config))
else
console.log "No user config specified. Using global settings."
catch err
......
......@@ -9,7 +9,8 @@
"errorhandler ": "*",
"ejs": ">= 0.0.1",
"socket.io": "1.*",
"tail": "*"
"tail": "*",
"extend": "~1.3.0"
},
"scripts": {
"install": "bash scripts/install.sh",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment