mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-14 08:36:26 +00:00
0e91fda451
Ignore environment variables and instead use static cache directory for third party tools. Closes #10094 BREAKING CHANGE: Renovate will now override any package manager cache locations configured in env variables. # Conflicts: # lib/manager/gomod/__snapshots__/artifacts.spec.ts.snap # lib/manager/gomod/artifacts.ts
27 lines
861 B
TypeScript
27 lines
861 B
TypeScript
import { dirname } from 'path';
|
|
import { join } from 'upath';
|
|
import dataFiles from '../../data-files.generated';
|
|
import { ensureCacheDir, outputFile, readLocalFile } from '../../util/fs';
|
|
import type { PythonSetup } from './types';
|
|
|
|
// need to match filename in `data/extract.py`
|
|
const REPORT = 'renovate-pip_setup-report.json';
|
|
const EXTRACT = 'renovate-pip_setup-extract.py';
|
|
|
|
let extractPy: string | undefined;
|
|
|
|
export async function getExtractFile(): Promise<string> {
|
|
if (extractPy) {
|
|
return extractPy;
|
|
}
|
|
|
|
extractPy = join(await ensureCacheDir('pip_setup'), EXTRACT);
|
|
await outputFile(extractPy, dataFiles.get('data/extract.py'));
|
|
|
|
return extractPy;
|
|
}
|
|
|
|
export async function parseReport(packageFile: string): Promise<PythonSetup> {
|
|
const data = await readLocalFile(join(dirname(packageFile), REPORT), 'utf8');
|
|
return JSON.parse(data);
|
|
}
|