Skip to content

Commit

Permalink
Throw an error in builds on duplicate redirects
Browse files Browse the repository at this point in the history
  • Loading branch information
ptgott committed Oct 10, 2024
1 parent f00eaeb commit 2186534
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions server/config-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,16 @@ export const loadConfig = (version: string) => {
);
}

const duplicateRedirects = checkDuplicateRedirects(config.redirects);
if (duplicateRedirects.length > 0) {
throw new Error(
"Error parsing docs config file " +
join("content", version, "docs", "config.json") +
": Found redirects with duplicate sources: " +
JSON.stringify(duplicateRedirects, null, 2)
);
}

validateConfig<Config>(validator, config);

config.navigation.forEach((item, i) => {
Expand Down

0 comments on commit 2186534

Please sign in to comment.