Skip to content

Commit

Permalink
docs: resolve link checking successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
calebpollman committed Oct 25, 2023
1 parent 702c332 commit 9496881
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs/scripts/link-checker-puppeteer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ function reportResult(links: LinkInfo[]) {
}
} else {
console.log('🎉 All links look good!');
process.exit();
}
}

Expand Down Expand Up @@ -95,7 +96,7 @@ async function runLinkChecker() {
};
});

await console.table(allPagesPathsNum);
console.table(allPagesPathsNum);

const links = results.reduce((acc, curr) => [...acc, ...curr.links], []);
reportResult(links);
Expand All @@ -104,5 +105,6 @@ async function runLinkChecker() {
try {
runLinkChecker();
} catch (err) {
console.log(`Docs link check failure: ${err.message}`);
process.exit(1);
}
9 changes: 2 additions & 7 deletions docs/scripts/util/checkLink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async function returnStatus({
}
}

export function checkLink(
export async function checkLink(
{
href,
tagName,
Expand All @@ -82,12 +82,7 @@ export function checkLink(
pageUrl: string;
},
linkIdx: number
): Promise<LinkInfo>;

export async function checkLink(
{ href, tagName, tagText, pageIdx, pageUrl },
linkIdx
) {
): Promise<LinkInfo> {
return new Promise(async (res, rej) => {
const linkData = { href, linkIdx, pageIdx, pageUrl, tagName, tagText };
if (!href) {
Expand Down

0 comments on commit 9496881

Please sign in to comment.