renovate/lib/workers/repository/process/index.js
Rhys Arkins ecdcd9df4f
feat: refactor dependency extraction (#1912)
Rewrite of dependency extraction, particularly for npm. Paves way for easier addition of new package managers.

Closes #1882
2018-05-09 08:03:59 +02:00

30 lines
1.1 KiB
JavaScript

const { mergeChildConfig } = require('../../../config');
const { extractAndUpdate } = require('./extract-update');
module.exports = {
processRepo,
};
async function processRepo(config) {
logger.debug('processRepo()');
if (config.baseBranches && config.baseBranches.length) {
logger.info({ baseBranches: config.baseBranches }, 'baseBranches');
let res;
let branches = [];
let branchList = [];
for (const baseBranch of config.baseBranches) {
logger.debug(`baseBranch: ${baseBranch}`);
const baseBranchConfig = mergeChildConfig(config, { baseBranch });
baseBranchConfig.branchPrefix += `${baseBranch}-`;
baseBranchConfig.hasBaseBranches = true;
platform.setBaseBranch(baseBranch);
const baseBranchRes = await extractAndUpdate(baseBranchConfig);
({ res } = baseBranchRes);
branches = branches.concat(baseBranchRes.branches);
branchList = branchList.concat(baseBranchRes.branchList);
}
return { res, branches, branchList };
}
logger.debug('No baseBranches');
return extractAndUpdate(config);
}