Now when checking config file if the value is blank it checks env variables for a variable defined as uppcase section + option with a separator of _.
This commit is contained in:
@@ -27,6 +27,11 @@ class Config {
|
|||||||
|
|
||||||
const field = new Field(this.fields[section][option])
|
const field = new Field(this.fields[section][option])
|
||||||
|
|
||||||
|
if (field.value === '') {
|
||||||
|
const envField = process.env[[section.toUpperCase(), option.toUpperCase()].join('_')]
|
||||||
|
if (envField !== undefined && envField.length !== 0) { return envField }
|
||||||
|
}
|
||||||
|
|
||||||
if (field.value === undefined) {
|
if (field.value === undefined) {
|
||||||
throw new Error(`${section} => ${option} is empty.`);
|
throw new Error(`${section} => ${option} is empty.`);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user