Skip to content

Commit

Permalink
refactor: global config massage
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Jan 11, 2020
1 parent abbc914 commit da22cc3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
11 changes: 11 additions & 0 deletions lib/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,17 @@ export async function parseConfigs(
// Remove log file entries
delete config.logFile;
delete config.logFileLevel;

// Move global variables that we need to use later
const importGlobals = ['prBanner', 'prFooter'];
config.global = {};
importGlobals.forEach(key => {
config.global[key] = config[key];
delete config[key];
});
global.trustLevel = config.trustLevel || 'low';
delete config.trustLevel;

return config;
}

Expand Down
10 changes: 1 addition & 9 deletions lib/workers/global/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,7 @@ export async function start(): Promise<0 | 1> {
config = await initPlatform(config);
config = await setDirectories(config);
config = await autodiscoverRepositories(config);
// Move global variables that we need to use later
const importGlobals = ['prBanner', 'prFooter'];
config.global = {};
importGlobals.forEach(key => {
config.global[key] = config[key];
delete config[key];
});
global.trustLevel = config.trustLevel || 'low';
delete config.trustLevel;

limits.init(config);
setEmojiConfig(config);
setDockerUser(config.dockerUser);
Expand Down

0 comments on commit da22cc3

Please sign in to comment.