renovate/lib/workers/repository/extract/index.ts

32 lines
1.1 KiB
TypeScript
Raw Normal View History

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