Skip to content
Snippets Groups Projects
Commit 394bc931 authored by Rhys Arkins's avatar Rhys Arkins
Browse files

refactor: simply global mergeconfig

parent 96275379
No related branches found
No related tags found
No related merge requests found
......@@ -33,8 +33,8 @@ async function start() {
delete config[key];
});
// Iterate through repositories sequentially
for (let index = 0; index < config.repositories.length; index += 1) {
const repoConfig = module.exports.getRepositoryConfig(config, index);
for (const repository of config.repositories) {
const repoConfig = getRepositoryConfig(config, repository);
await repositoryWorker.renovateRepository(repoConfig, repoConfig.token);
}
logger.setMeta({});
......@@ -45,12 +45,11 @@ async function start() {
}
}
function getRepositoryConfig(globalConfig, index) {
let repository = globalConfig.repositories[index];
if (typeof repository === 'string') {
repository = { repository };
}
const repoConfig = configParser.mergeChildConfig(globalConfig, repository);
function getRepositoryConfig(globalConfig, repository) {
const repoConfig = configParser.mergeChildConfig(
globalConfig,
typeof repository === 'string' ? { repository } : repository
);
repoConfig.isGitHub = repoConfig.platform === 'github';
repoConfig.isGitLab = repoConfig.platform === 'gitlab';
repoConfig.isVsts = repoConfig.platform === 'vsts';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment