1 | fs = require 'fs'
|
2 | coffee = require 'coffee-script'
|
3 | _ = require 'underscore'
|
4 |
|
5 | config = {}
|
6 |
|
7 | mixins =
|
8 | _reload: () =>
|
9 | configFile = "#{process.cwd()}/config.coffee"
|
10 | contents = fs.readFileSync( configFile ).toString()
|
11 | compiled = coffee.compile( contents, { bare: true } )
|
12 | newConfig = eval compiled
|
13 | if newConfig
|
14 | _.extend( exports, config, newConfig, mixins )
|
15 | else
|
16 | console.log "Could not parse config file #{configFile}"
|
17 |
|
18 | mixins._reload()
|