fix: config was not parsed properly

This commit is contained in:
NGPixel
2017-05-13 14:44:04 -04:00
parent 7d299bc73a
commit 6ae6d3382d
3 changed files with 12 additions and 3 deletions

View File

@@ -31,9 +31,13 @@ module.exports = (confPaths) => {
let appdata = {}
try {
appconfig = yaml.safeLoad(_.deepMap(fs.readFileSync(confPaths.config, 'utf8'), c => {
return _.replace(c, (/\$\([A-Z0-9_]+\)/g, (m) => { return process.env[m] }))
}))
appconfig = yaml.safeLoad(
_.replace(
fs.readFileSync(confPaths.config, 'utf8'),
(/\$\([A-Z0-9_]+\)/g,
(m) => { return process.env[m] })
)
)
appdata = yaml.safeLoad(fs.readFileSync(confPaths.data, 'utf8'))
appdata.regex = require(confPaths.dataRegex)
} catch (ex) {