feat(manager): renovate nuget DotNetCliToolReference (#6200)

This commit is contained in:
Michael Kriese 2020-05-11 13:12:47 +02:00 committed by GitHub
parent 3dbabadecf
commit 29fe28c359
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View file

@ -144,6 +144,12 @@ Array [
"depName": "Range3", "depName": "Range3",
"depType": "nuget", "depType": "nuget",
}, },
Object {
"currentValue": "1.0.0",
"datasource": "nuget",
"depName": "Microsoft.VisualStudio.Web.CodeGeneration.Tools",
"depType": "nuget",
},
] ]
`; `;

View file

@ -63,6 +63,7 @@ async function determineRegistryUrls(
return registryUrls; return registryUrls;
} }
const packageRe = /<(?:PackageReference|DotNetCliToolReference).*Include\s*=\s*"([^"]+)".*Version\s*=\s*"(?:[[])?(?:([^"(,[\]]+)\s*(?:,\s*[)\]]|])?)"/;
export async function extractPackageFile( export async function extractPackageFile(
content: string, content: string,
packageFile: string, packageFile: string,
@ -90,9 +91,7 @@ export async function extractPackageFile(
* so we don't include it in the extracting regexp * so we don't include it in the extracting regexp
*/ */
const match = /<PackageReference.*Include\s*=\s*"([^"]+)".*Version\s*=\s*"(?:[[])?(?:([^"(,[\]]+)\s*(?:,\s*[)\]]|])?)"/.exec( const match = packageRe.exec(line);
line
);
if (match) { if (match) {
const depName = match[1]; const depName = match[1];
const currentValue = match[2]; const currentValue = match[2];