Fixed issue with env and config

master
Mark Moffat 2019-12-18 20:33:26 +10:30
parent 7e8183bf8f
commit c76bff7036
1 changed files with 7 additions and 7 deletions

View File

@ -209,6 +209,13 @@ const getConfig = () => {
config = Object.assign(config, localConfigFile);
}
// Override from env.yaml environment file
Object.keys(config).forEach((configKey) => {
if(process.env[configKey]){
config[configKey] = process.env[configKey];
}
});
config.customCss = typeof config.customCss !== 'undefined' ? escape.decode(config.customCss) : null;
config.footerHtml = typeof config.footerHtml !== 'undefined' ? escape.decode(config.footerHtml) : null;
config.googleAnalytics = typeof config.googleAnalytics !== 'undefined' ? escape.decode(config.googleAnalytics) : null;
@ -221,13 +228,6 @@ const getConfig = () => {
config.themeViews = '../views/themes/' + config.theme + '/';
// Override from env.yaml environment file
Object.keys(config).forEach((configKey) => {
if(process.env[configKey]){
config[configKey] = process.env[configKey];
}
});
// set the environment for files
config.env = '.min';
if(process.env.NODE_ENV === 'development' || process.env.NODE_ENV === undefined){