2019-12-12 03:38:40 +00:00
|
|
|
import { logger } from '../../../logger';
|
|
|
|
import { getManagerList } from '../../../manager';
|
|
|
|
import { getManagerConfig, RenovateConfig } from '../../../config';
|
|
|
|
import { getManagerPackageFiles } from './manager-files';
|
|
|
|
import { PackageFile } from '../../../manager/common';
|
2018-05-09 06:03:59 +00:00
|
|
|
|
2019-12-12 03:38:40 +00:00
|
|
|
export async function extractAllDependencies(
|
|
|
|
config: RenovateConfig
|
|
|
|
): Promise<Record<string, PackageFile[]>> {
|
|
|
|
const extractions: Record<string, PackageFile[]> = {};
|
2018-05-09 06:03:59 +00:00
|
|
|
let fileCount = 0;
|
|
|
|
for (const manager of getManagerList()) {
|
2019-11-23 19:44:21 +00:00
|
|
|
if (
|
|
|
|
config.enabledManagers.length &&
|
|
|
|
!config.enabledManagers.includes(manager)
|
|
|
|
) {
|
|
|
|
logger.debug(`${manager} is not in enabledManagers list - skipping`);
|
|
|
|
continue; // eslint-disable-line
|
|
|
|
}
|
2018-05-09 06:03:59 +00:00
|
|
|
const managerConfig = getManagerConfig(config, manager);
|
|
|
|
managerConfig.manager = manager;
|
2019-11-23 19:44:21 +00:00
|
|
|
const packageFiles = await getManagerPackageFiles(managerConfig);
|
2018-12-12 10:26:43 +00:00
|
|
|
if (packageFiles && packageFiles.length) {
|
2018-05-09 06:03:59 +00:00
|
|
|
fileCount += packageFiles.length;
|
2020-02-24 07:43:01 +00:00
|
|
|
logger.debug(`Found ${manager} package files`);
|
2018-05-09 06:03:59 +00:00
|
|
|
extractions[manager] = packageFiles;
|
|
|
|
}
|
|
|
|
}
|
2018-05-31 11:03:36 +00:00
|
|
|
logger.debug(`Found ${fileCount} package file(s)`);
|
2018-05-09 06:03:59 +00:00
|
|
|
return extractions;
|
|
|
|
}
|