Skip to content

Commit 7f5aec1

Browse files
committed
Avoid duplicates in the redirects artifact
1 parent 5ab6af4 commit 7f5aec1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/tooling/docs-assembler/Building/AssemblerBuilder.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,9 @@ public async Task BuildAllAsync(FrozenDictionary<string, AssemblerDocumentationS
9292
_ = await exporter.FinishExportAsync(context.OutputDirectory, ctx);
9393
}
9494

95-
96-
await OutputRedirectsAsync(redirects, ctx);
95+
await OutputRedirectsAsync(redirects
96+
.Where(r => !r.Key.TrimEnd('/').Equals(r.Value.TrimEnd('/'), StringComparison.OrdinalIgnoreCase))
97+
.ToDictionary(r => r.Key, r => r.Value), ctx);
9798

9899
tasks = markdownExporters.Select(async e => await e.StopAsync(ctx));
99100
await Task.WhenAll(tasks);
@@ -120,6 +121,7 @@ ICrossLinkResolver linkResolver
120121
allRedirects[Resolve(k)] = Resolve(t);
121122
}
122123
}
124+
allRedirects = allRedirects.
123125
string Resolve(string relativeMarkdownPath)
124126
{
125127
var uri = linkResolver.UriResolver.Resolve(new Uri($"{repository}://{relativeMarkdownPath}"),

0 commit comments

Comments
 (0)