mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-12 06:56:24 +00:00
fix(cake): fix explicit registryUrl (#26713)
This commit is contained in:
parent
adc9884225
commit
1679f05b2a
3 changed files with 10 additions and 2 deletions
|
@ -2,6 +2,8 @@ foo
|
||||||
#addin nuget:?package=Foo.Foo
|
#addin nuget:?package=Foo.Foo
|
||||||
#addin "nuget:?package=Bim.Bim&version=6.6.6"
|
#addin "nuget:?package=Bim.Bim&version=6.6.6"
|
||||||
#tool nuget:https://example.com?package=Bar.Bar&version=2.2.2
|
#tool nuget:https://example.com?package=Bar.Bar&version=2.2.2
|
||||||
|
#tool nuget:https://example.com/feed/v3/?package=Cake.Git&version=2.2.3
|
||||||
|
#tool nuget:https://example.com/feed/v3/index.json?package=Cake.MinVer&version=2.2.4
|
||||||
#module nuget:file:///tmp/?package=Baz.Baz&version=3.3.3
|
#module nuget:file:///tmp/?package=Baz.Baz&version=3.3.3
|
||||||
#load nuget:?package=Cake.7zip&version=1.0.3
|
#load nuget:?package=Cake.7zip&version=1.0.3
|
||||||
#l nuget:?package=Cake.asciidoctorj&version=1.0.0
|
#l nuget:?package=Cake.asciidoctorj&version=1.0.0
|
||||||
|
|
|
@ -7,7 +7,12 @@ describe('modules/manager/cake/index', () => {
|
||||||
deps: [
|
deps: [
|
||||||
{ depName: 'Foo.Foo', currentValue: undefined },
|
{ depName: 'Foo.Foo', currentValue: undefined },
|
||||||
{ depName: 'Bim.Bim', currentValue: '6.6.6' },
|
{ depName: 'Bim.Bim', currentValue: '6.6.6' },
|
||||||
{ depName: 'Bar.Bar', registryUrls: ['https://example.com'] },
|
{ depName: 'Bar.Bar', registryUrls: ['https://example.com/'] },
|
||||||
|
{ depName: 'Cake.Git', registryUrls: ['https://example.com/feed/v3/'] },
|
||||||
|
{
|
||||||
|
depName: 'Cake.MinVer',
|
||||||
|
registryUrls: ['https://example.com/feed/v3/index.json'],
|
||||||
|
},
|
||||||
{ depName: 'Baz.Baz', skipReason: 'unsupported-url' },
|
{ depName: 'Baz.Baz', skipReason: 'unsupported-url' },
|
||||||
{ depName: 'Cake.7zip', currentValue: '1.0.3' },
|
{ depName: 'Cake.7zip', currentValue: '1.0.3' },
|
||||||
{ depName: 'Cake.asciidoctorj', currentValue: '1.0.0' },
|
{ depName: 'Cake.asciidoctorj', currentValue: '1.0.0' },
|
||||||
|
|
|
@ -31,7 +31,8 @@ function parseDependencyLine(line: string): PackageDependency | null {
|
||||||
const isEmptyHost = url.startsWith('?');
|
const isEmptyHost = url.startsWith('?');
|
||||||
url = isEmptyHost ? `http://localhost/${url}` : url;
|
url = isEmptyHost ? `http://localhost/${url}` : url;
|
||||||
|
|
||||||
const { origin: registryUrl, protocol, searchParams } = new URL(url);
|
const { origin, pathname, protocol, searchParams } = new URL(url);
|
||||||
|
const registryUrl = `${origin}${pathname}`;
|
||||||
|
|
||||||
const depName = searchParams.get('package')!;
|
const depName = searchParams.get('package')!;
|
||||||
const currentValue = searchParams.get('version') ?? undefined;
|
const currentValue = searchParams.get('version') ?? undefined;
|
||||||
|
|
Loading…
Reference in a new issue