mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
refactor(npm): npmrc string check
This commit is contained in:
parent
e541f3ed28
commit
486decbee6
1 changed files with 4 additions and 4 deletions
|
@ -102,11 +102,11 @@ export async function extractPackageFile(
|
|||
await deleteLocalFile(npmrcFileName);
|
||||
} else {
|
||||
npmrc = await readLocalFile(npmrcFileName, 'utf8');
|
||||
if (npmrc?.includes('package-lock')) {
|
||||
logger.debug('Stripping package-lock setting from npmrc');
|
||||
npmrc = npmrc.replace(/(^|\n)package-lock.*?(\n|$)/g, '\n');
|
||||
}
|
||||
if (is.string(npmrc)) {
|
||||
if (npmrc.includes('package-lock')) {
|
||||
logger.debug('Stripping package-lock setting from npmrc');
|
||||
npmrc = npmrc.replace(/(^|\n)package-lock.*?(\n|$)/g, '\n');
|
||||
}
|
||||
if (npmrc.includes('=${') && getAdminConfig().trustLevel !== 'high') {
|
||||
logger.debug('Discarding .npmrc file with variables');
|
||||
ignoreNpmrcFile = true;
|
||||
|
|
Loading…
Reference in a new issue