mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 08:36:26 +00:00
ecdcd9df4f
Rewrite of dependency extraction, particularly for npm. Paves way for easier addition of new package managers. Closes #1882
30 lines
1.1 KiB
JavaScript
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);
|
|
}
|