fix(core): update

This commit is contained in:
Philipp Kunz 2019-01-06 03:36:40 +01:00
parent 7844fdb954
commit f7362e5444

View File

@ -104,12 +104,16 @@ export class Qenv {
* gets the required env values * gets the required env values
*/ */
private getRequiredEnvVars = () => { private getRequiredEnvVars = () => {
const qenvFile = plugins.smartfile.fs.toObjectSync(this.qenvFilePathAbsolute); let qenvFile: any = {};
if (!qenvFile.required) { if(plugins.smartfile.fs.fileExistsSync(this.qenvFilePathAbsolute)) {
this.logger.log('warn', `env File does not contain a 'required' Array!`); qenvFile = plugins.smartfile.fs.toObjectSync(this.qenvFilePathAbsolute);
} }
for (const keyArg of Object.keys(qenvFile.required)) { if (!qenvFile || !qenvFile.required || !Array.isArray(qenvFile.required)) {
this.requiredEnvVars.push(qenvFile.required[keyArg]); this.logger.log('warn', `env File does not contain a 'required' Array!`);
} else {
for (const keyArg of Object.keys(qenvFile.required)) {
this.requiredEnvVars.push(qenvFile.required[keyArg]);
}
} }
} }