Commit 6ae6d338 authored by NGPixel's avatar NGPixel

fix: config was not parsed properly

parent 7d299bc7
...@@ -119,6 +119,7 @@ ...@@ -119,6 +119,7 @@
"through2": "^2.0.3", "through2": "^2.0.3",
"validator": "^7.0.0", "validator": "^7.0.0",
"validator-as-promised": "^1.0.2", "validator-as-promised": "^1.0.2",
"vue-template-es2015-compiler": "^1.5.2",
"winston": "^2.3.1", "winston": "^2.3.1",
"yargs": "^8.0.1" "yargs": "^8.0.1"
}, },
......
...@@ -31,9 +31,13 @@ module.exports = (confPaths) => { ...@@ -31,9 +31,13 @@ module.exports = (confPaths) => {
let appdata = {} let appdata = {}
try { try {
appconfig = yaml.safeLoad(_.deepMap(fs.readFileSync(confPaths.config, 'utf8'), c => { appconfig = yaml.safeLoad(
return _.replace(c, (/\$\([A-Z0-9_]+\)/g, (m) => { return process.env[m] })) _.replace(
})) fs.readFileSync(confPaths.config, 'utf8'),
(/\$\([A-Z0-9_]+\)/g,
(m) => { return process.env[m] })
)
)
appdata = yaml.safeLoad(fs.readFileSync(confPaths.data, 'utf8')) appdata = yaml.safeLoad(fs.readFileSync(confPaths.data, 'utf8'))
appdata.regex = require(confPaths.dataRegex) appdata.regex = require(confPaths.dataRegex)
} catch (ex) { } catch (ex) {
......
This diff was suppressed by a .gitattributes entry.
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