Prevent from overriding global config if it's already done and parsed content is empty.

This commit is contained in:
sbenmoussati 2022-11-02 14:55:07 +01:00 committed by Salah Benmoussati
parent abdea98dd4
commit 4344fee1ec

View File

@ -721,9 +721,12 @@ class Config {
}
return;
}
this.globalConfig = this.parseConfigData(
const parsedConfigData = this.parseConfigData(
fs.readFileSync(this.globalConfigPath, 'utf8'),
);
if (parsedConfigData && Object.keys(parsedConfigData).length > 0) {
this.globalConfig = parsedConfigData;
}
logger.info(`config-handler: Global configuration: `, this.globalConfig);
}